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 36 37
| <UserControl.Resources>
<viewmodel:GraphMarkViewModel x:Key="ViewModel" />
</UserControl.Resources>
<Grid DataContext="{Binding Source={StaticResource ViewModel}}" Background="Beige">
<StackPanel>
<ListView ItemsSource="{Binding GraphMarkParts}" Background="AliceBlue">
<ListView.ItemTemplate>
<DataTemplate>
<Expander Background="Bisque">
<Expander.Header>
<TextBox Text="{Binding Part}" Width="120" />
</Expander.Header>
<StackPanel Background="Red">
<Button Content="Ajouter une ligne" Command="{Binding AddLineCommand, Source={StaticResource ViewModel}}" CommandParameter="{Binding}"/>
<ListView ItemsSource="{Binding GraphMarkLines}" Background="Aquamarine">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Background="Black">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Code}" Grid.Column="0" Width="20" />
<TextBox Text="{Binding Line}" Grid.Column="1" Width="200" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Expander>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button Content="Ajouter" Command="{Binding AddCommand}"/>
<Button Content="Sauvegarder" Command="{Binding SaveCommand}"/>
</StackPanel>
</Grid> |
Partager