RecipeSequenceSelectDialogView.xaml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <UserControl x:Class="VirgoUI.Client.Models.Recipe.RecipeSequenceSelectDialogView"
  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. xmlns:local="clr-namespace:VirgoUI.Client.Models.Recipe"
  7. xmlns:cal="http://www.caliburn.org"
  8. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  9. mc:Ignorable="d"
  10. Width="350"
  11. Height="500">
  12. <UserControl.Resources>
  13. <HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
  14. <StackPanel>
  15. <TextBlock Text="{Binding Name}" />
  16. </StackPanel>
  17. </HierarchicalDataTemplate>
  18. </UserControl.Resources>
  19. <Border BorderBrush="Gray" BorderThickness="0,1,0,0" Background="{DynamicResource Tab_BG}">
  20. <Grid Margin="20,30">
  21. <Grid.RowDefinitions>
  22. <RowDefinition />
  23. <RowDefinition Height="auto"/>
  24. </Grid.RowDefinitions>
  25. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content_Highlight}">
  26. <TreeView x:Name="PART_TREE" Margin="5" ItemsSource="{Binding Files[0].Files}" ItemTemplate="{StaticResource FileTemplate}"
  27. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling">
  28. <!--Height should add for VirtualizingPanel, otherwise the App will be slow-->
  29. <TreeView.ItemContainerStyle>
  30. <Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
  31. <Setter Property="IsExpanded" Value="True"></Setter>
  32. </Style>
  33. </TreeView.ItemContainerStyle>
  34. <i:Interaction.Triggers>
  35. <i:EventTrigger EventName="SelectedItemChanged">
  36. <cal:ActionMessage MethodName="TreeSelectChanged">
  37. <cal:Parameter Value="{Binding SelectedItem, ElementName=PART_TREE}" />
  38. </cal:ActionMessage>
  39. </i:EventTrigger>
  40. <i:EventTrigger EventName="MouseDoubleClick">
  41. <cal:ActionMessage MethodName="OnMouseDoubleClick">
  42. </cal:ActionMessage>
  43. </i:EventTrigger>
  44. </i:Interaction.Triggers>
  45. </TreeView>
  46. </Border>
  47. <StackPanel Grid.Row="1" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
  48. <Button Content="OK" Width="90" Height="30">
  49. <i:Interaction.Triggers>
  50. <i:EventTrigger EventName="Click">
  51. <cal:ActionMessage MethodName="OK">
  52. </cal:ActionMessage>
  53. </i:EventTrigger>
  54. </i:Interaction.Triggers>
  55. </Button>
  56. <Button Content="Cancel" Margin="10,0,0,0" Width="90" Height="30">
  57. <i:Interaction.Triggers>
  58. <i:EventTrigger EventName="Click">
  59. <cal:ActionMessage MethodName="Cancel">
  60. </cal:ActionMessage>
  61. </i:EventTrigger>
  62. </i:Interaction.Triggers>
  63. </Button>
  64. </StackPanel>
  65. </Grid>
  66. </Border>
  67. </UserControl>