JD2022-TU1/main/tools/modules/JD.Oasis.Module/View/OasisToolWindow.xaml

77 lines
4.5 KiB
XML

<UserControl x:Class="JD.Oasis.Module.View.OasisToolWindow"
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:local="clr-namespace:JD.Oasis.Module.View"
xmlns:vm="clr-namespace:JD.Oasis.Module.ViewModel"
xmlns:grids="http://schemas.actiprosoftware.com/winfx/xaml/grids"
xmlns:tm="clr-namespace:JD.Oasis.Module.ViewModel.TreeViewModel"
xmlns:common="clr-namespace:JD.Oasis.Module.ViewModel.TreeViewModel.Common"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance Type=vm:OasisViewModel, IsDesignTimeCreatable=True}"
IsEnabled="{Binding IsUIEnabled}">
<UserControl.Resources>
<DataTemplate x:Key="MainColumnDataTemplate" DataType="{x:Type tm:OasisTreeNodeViewModel}">
<CheckBox IsChecked="{Binding IsChecked}" Margin="0,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Margin="0,0,5,0">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Source" Value="../Resources/folder_dialog.png"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsExpanded}" Value="True">
<Setter Property="Source" Value="../Resources/folder_dialog_open.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
</StackPanel>
</CheckBox>
</DataTemplate>
<DataTemplate x:Key="LocIdDataTemplate">
<ContentPresenter Content="{Binding}">
<ContentPresenter.Resources>
<DataTemplate DataType="{x:Type tm:FileTreeNodeViewModel}">
<TextBlock Text="{Binding LineId}" VerticalAlignment="Center"/>
</DataTemplate>
<DataTemplate DataType="{x:Type tm:FolderTreeNodeViewModel}">
<TextBlock Text="" VerticalAlignment="Center"/>
</DataTemplate>
</ContentPresenter.Resources>
</ContentPresenter>
</DataTemplate>
<DataTemplate x:Key="MasterTextDataTemplate">
<ContentPresenter Content="{Binding}">
<ContentPresenter.Resources>
<DataTemplate DataType="{x:Type tm:FileTreeNodeViewModel}">
<TextBlock Text="{Binding MasterText}" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"/>
</DataTemplate>
<DataTemplate DataType="{x:Type tm:FolderTreeNodeViewModel}">
<TextBlock Text="" VerticalAlignment="Center"/>
</DataTemplate>
</ContentPresenter.Resources>
</ContentPresenter>
</DataTemplate>
</UserControl.Resources>
<Grid>
<grids:TreeListView RootItem="{Binding RootNode}" IsRootItemVisible="True" CanColumnsReorder="False" CanColumnsResize="True" ItemSelecting="TreeListBox_OnItemSelecting">
<grids:TreeListView.ItemAdapter>
<tm:OasisTreeListBoxItemAdapter/>
</grids:TreeListView.ItemAdapter>
<grids:TreeListView.Columns>
<grids:TreeListViewColumn Header="" CellTemplate="{StaticResource MainColumnDataTemplate}"/>
<grids:TreeListViewColumn Header="LocID" CellTemplate="{StaticResource LocIdDataTemplate}" Width="Auto"/>
<grids:TreeListViewColumn Header="Master Text" CellTemplate="{StaticResource MasterTextDataTemplate}" Width="Auto"/>
</grids:TreeListView.Columns>
<grids:TreeListView.ItemContainerStyle>
<Style TargetType="{x:Type grids:TreeListViewItem}">
<Setter Property="Focusable" Value="False"/>
</Style>
</grids:TreeListView.ItemContainerStyle>
</grids:TreeListView>
</Grid>
</UserControl>