1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<Window x:Class="WpfTestUserControlBogus.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfTestUserControlBogus"
xmlns:lib="clr-namespace:WpfLibrary;assembly=WpfLibrary"
Title="Window2" Height="370" Width="380" >
<Window.Resources>
<local:Items x:Key="mySource"></local:Items>
<DataTemplate x:Key="monItemsTemplate"
DataType="{x:Type local:monItem}">
<WrapPanel>
<TextBlock Text="{Binding Path=Nom}" Margin="10,10,10,10"/>
<TextBlock Text="{Binding Path=Prenom}" Margin="10,10,10,10"/>
<TextBlock Text="{Binding Path=CanAnimated}" Margin="10,10,10,10"/>
</WrapPanel>
</DataTemplate>
</Window.Resources>
<Grid
Margin="10,10,10,10" >
<Grid.RowDefinitions>
<RowDefinition MinHeight="60"></RowDefinition>
</Grid.RowDefinitions>
<lib:UserControlBogus
Margin="0,0,0,0"
Name="Bogus"
Txt="{Binding Source={StaticResource mySource},Path=Nom}"
ItemsSource ="{Binding Source={StaticResource mySource}}"
ItemTemplate="{StaticResource monItemsTemplate}"
>
</lib:UserControlBogus>
</Grid>
</Window> |
Partager