123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Sequence.RecipeSequenceSelectDialogView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
- xmlns:micro="clr-namespace:Caliburn.Micro"
- mc:Ignorable="d"
- Width="350"
- Height="500">
- <UserControl.Resources>
- <HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
- <StackPanel>
- <TextBlock Text="{Binding Name}" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </UserControl.Resources>
- <Border BorderBrush="Gray" BorderThickness="0,1,0,0" Background="{DynamicResource Tab_BG}">
- <Grid Margin="20,30">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content_Highlight}">
- <TreeView x:Name="PART_TREE" Margin="5" ItemsSource="{Binding Files[0].Files}" ItemTemplate="{StaticResource FileTemplate}"
- VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
- Height="{Binding Path=ActualHeight,ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
- <!--Height should add for VirtualizingPanel, otherwise the App will be slow-->
- <TreeView.ItemContainerStyle>
- <Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
- <Setter Property="IsExpanded" Value="True"></Setter>
- </Style>
- </TreeView.ItemContainerStyle>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedItemChanged">
- <micro:ActionMessage MethodName="TreeSelectChanged">
- <micro:Parameter Value="{Binding SelectedItem, ElementName=PART_TREE}" />
- </micro:ActionMessage>
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseDoubleClick">
- <micro:ActionMessage MethodName="TreeMouseDoubleClick">
- <micro:Parameter Value="{Binding SelectedItem, ElementName=PART_TREE}" />
- </micro:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </TreeView>
- </Border>
- <StackPanel Grid.Row="1" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
- <Button Content="OK" Width="90" Height="30">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <micro:ActionMessage MethodName="OK">
- </micro:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Button>
- <Button Content="Cancel" Margin="10,0,0,0" Width="90" Height="30">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <micro:ActionMessage MethodName="Cancel">
- </micro:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Button>
- </StackPanel>
- </Grid>
- </Border>
- </UserControl>
|