RecipeSequenceSelectView.xaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <Window x:Class="Venus_MainPages.Views.RecipeSequenceSelectView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. WindowStartupLocation="CenterOwner"
  8. WindowStyle="SingleBorderWindow" ResizeMode="NoResize" ShowInTaskbar="False"
  9. Background="LightSkyBlue" Width="350" Height="500" Name="recipeSequenceSelect">
  10. <Window.Resources>
  11. <HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
  12. <StackPanel>
  13. <TextBlock Text="{Binding Name}" />
  14. </StackPanel>
  15. </HierarchicalDataTemplate>
  16. </Window.Resources>
  17. <Border BorderBrush="Gray" BorderThickness="0,1,0,0" >
  18. <Grid Margin="20,30">
  19. <Grid.RowDefinitions>
  20. <RowDefinition />
  21. <RowDefinition Height="auto"/>
  22. </Grid.RowDefinitions>
  23. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="White">
  24. <TreeView x:Name="PART_TREE" Margin="5" ItemsSource="{Binding Files[0].Files}" ItemTemplate="{StaticResource FileTemplate}"
  25. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" SelectedItemChanged="PART_TREE_SelectedItemChanged"
  26. Height="{Binding Path=ActualHeight,ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" MouseDoubleClick="PART_TREE_MouseDoubleClick">
  27. <!--Height should add for VirtualizingPanel, otherwise the App will be slow-->
  28. <TreeView.ItemContainerStyle>
  29. <Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
  30. <Setter Property="IsExpanded" Value="True"></Setter>
  31. </Style>
  32. </TreeView.ItemContainerStyle>
  33. </TreeView>
  34. </Border>
  35. <StackPanel Grid.Row="1" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
  36. <Button Content="OK" Width="90" Height="30" Click="buttonOK_Click" x:Name="buttonOK"/>
  37. <Button Content="Cancel" Margin="10,0,0,0" Width="90" Height="30" Click="buttonCancel_Click" x:Name="buttonCancel"/>
  38. </StackPanel>
  39. </Grid>
  40. </Border>
  41. </Window>