Files
2026-04-17 14:55:32 -04:00

79 lines
5.9 KiB
XML

<base:BaseView x:Class="DTS.Viewer.GraphList.GraphMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:graphList="clr-namespace:DTS.Viewer.GraphList">
<base:BaseView.Resources>
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
<converters:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter" />
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter"/>
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<HierarchicalDataTemplate ItemsSource="{Binding Path=Groups}" x:Key="Templatekey">
<TextBlock Text="{Binding Path=Name}" AutomationProperties.AutomationId="TestIDNameLbl" />
<HierarchicalDataTemplate.ItemTemplate >
<HierarchicalDataTemplate ItemsSource="{Binding Path=Channels}" >
<StackPanel Orientation="Horizontal" Background="Transparent" AutomationProperties.AutomationId="TestContentItems">
<CheckBox IsChecked="{Binding Path=IsLocked, Mode=TwoWay}" Margin="1,1,3,1" Visibility="{Binding Path=IsGraph, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}"
IsEnabled="{Binding Path=CanLock, Mode=TwoWay}" AutomationProperties.AutomationId="GraphChanSelectionChkBx"/>
<TextBlock VerticalAlignment="Center" Text="{Binding DisplayName}" AutomationProperties.AutomationId="TvTestViewItemNameLbl"/>
</StackPanel>
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Opacity="{Binding Path=IsError, Converter={StaticResource BooleanToOpacityConverter}, Mode=TwoWay}"
Background="Transparent" AutomationProperties.AutomationId="ChannelItem">
<CheckBox IsChecked="{Binding Path=IsLocked, Mode=TwoWay}" Margin="0,1,3,1"
Visibility="{Binding Path=IsGraphChannel, Converter={StaticResource InverseBooleanToVisibilityConverter}, Mode=TwoWay}" Focusable="False"
IsEnabled="{Binding Path=CanLock, Mode=OneWay}" AutomationProperties.AutomationId="ChanLockChkBx"
/>
<Rectangle Width="15" Height="15" Fill="{Binding Path=ChannelColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=TwoWay}" Visibility="Visible" />
<TextBlock VerticalAlignment="Center" Text="{Binding Path=ChannelDisplayName}" Foreground="{Binding Path=ErrorColor, Mode=TwoWay, Converter={StaticResource ColorToSolidColorBrushConverter}}" Margin="5,0,0,0" AutomationProperties.AutomationId="ChanNameLbl"/>
<TextBlock VerticalAlignment="Center" Text="{Binding Path=ErrorMessage}" FontWeight="Bold" Foreground="{Binding Path=ErrorColor, Mode=TwoWay, Converter={StaticResource ColorToSolidColorBrushConverter}}" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
<SolidColorBrush Color="LightBlue" x:Key="{x:Static SystemColors.HighlightBrushKey}"/>
<Style x:Key="TvItemStyle" TargetType="{x:Type TreeViewItem}">
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="IsSelected" Value="{Binding Path=IsSelected}"/>
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded}"/>
<Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
<Setter Property="graphList:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
<Setter Property="graphList:VirtualToggleButton.IsLocked" Value="{Binding IsLocked}" />
<Setter Property="AutomationProperties.AutomationId" Value="TvTestItem" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</base:BaseView.Resources>
<Grid x:Name="GraphMainRegion" IsEnabled="{Binding TestModified, Converter={StaticResource InverseBooleanConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentControl Grid.Row="0" Content="{Binding FilterView}" IsEnabled="{Binding IsFilterEnabled}"/>
<TreeView Grid.Row="1" x:Name="TvTestChannels" ItemsSource="{Binding TestChannelsTree}"
ItemTemplate="{StaticResource Templatekey}"
ItemContainerStyle="{StaticResource TvItemStyle}"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Width="{Binding ElementName=GraphMainRegion, Path=Width}" />
</Grid>
</base:BaseView>