Can a Resource Dictionary be used in xaml to instantiate Page?

0

What happens is that I have a Datagris and I wanted to load it dynamically in a Page, like this example

<GridView ItemsSource="{x:Bind Items}"
         ItemTemplate="{StaticResource ImageOverlayTemplate}"
         IsItemClickEnabled="False"
         IsSwipeEnabled="False"
         CanDragItems="False"
         SelectionMode="Single"
         SelectionChanged="Control1_SelectionChanged"
         ItemClick="Control1_ItemClick" />

he is installing this app: link

and I would like to create something similar, which loads a GridView by means of a list, but I do not know if I can create that list in some Dictionary of resources and I call them from the View something like:

Resource Dictionary

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Gestion5"
                    xmlns:mo="clr-namespace:Model"
                    xmlns:vm="clr-namespace:ViewModel"
                    xmlns:tp="clr-namespace:TabPages"
                    xmlns:wi="clr-namespace:Windows" >

    <p:Proceso x:Key="TERCERO.pro"
               CodeName="TERCERO"
               Title="Tercero"
               Subtitle="Archivo de terceros"
               DisplayImage="{StaticResource img32_terceros.png}"
               ViewModelType="{x:Type vm:TerceroVM}" 
               ViewType="{x:Type wi:TerceroWindow}"
               EntityType="{x:Type mo:Tercero}"
               IsPutData="True"
               Tipo="Catalogo"
               PkMode="IdCode"
               IsLicEnabled="{x:Null}"/>

</ResourceDictionary>

And in the view somewhere call it like this:

<StackPanel Orientation="Horizontal" Margin="2">
     <Label Content="Tercero:" />
     <my:MySuperBox Id="{Binding Document.Tercero1, Mode=TwoWay}" Proceso="{StaticResource TERCERO.pro}" Width="340" />
 </StackPanel>

Note that in MySuperBox I call the process 'TERCERO.pro' in the resource dictionary

Can I do that in UWP ???? is that I did this in WPF some time ago

    
asked by Wilmilcard 15.11.2018 в 22:16
source

0 answers