2025-08-15 16:34:31 +08:00

619 lines
42 KiB
XML

<UserControl x:Class="SWS.CAD.Views.Dialog.DialogIODistribution"
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:SWS.CAD.Views.CustomControl"
xmlns:CustomControl="clr-namespace:SWS.CAD.Views.CustomControl"
xmlns:Cvt="clr-namespace:SWS.CAD.Helper.Converter"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:prism="http://prismlibrary.com/"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" Width="1200" Height="750"
d:DesignHeight="450" d:DesignWidth="800">
<prism:Dialog.WindowStyle>
<Style TargetType="Window">
<Setter Property="Width" Value="1000"/>
<Setter Property="Height" Value="800"/>
<Setter Property="WindowState" Value="Normal"/>
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="ResizeMode" Value="NoResize"/>
<Setter Property="ShowInTaskbar" Value="True"/>
<Setter Property="Visibility" Value="{Binding WindowVisibility, Mode=TwoWay}"/>
<Setter Property="Topmost" Value="{Binding WindowTopmost, Mode=TwoWay}"/>
</Style>
</prism:Dialog.WindowStyle>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SWS.CAD;component/Views/Style/CustomStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Cvt:SelectedItemToBoolConverter x:Key="SelectedItemToBoolConverter"/>
<!-- GridViewCell样式 -->
<Style x:Key="CellTyle1" TargetType="telerik:GridViewCell" >
<Setter Property="Background" Value="#F8F9F1" />
</Style>
<!-- RadPathButton按钮样式 -->
<Style x:Key="PathStyle" TargetType="Path">
<Setter Property="Fill" Value="#E3F2FD"/>
<Setter Property="Stretch" Value="Uniform" />
</Style>
<Style TargetType="telerik:RadPathButton">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Padding" Value="2" />
<Setter Property="telerik:StyleManager.Theme" Value="Office2019"/>
<Setter Property="Margin" Value="1,3,3,5" />
<Setter Property="PathStyle" Value="{StaticResource PathStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:RadPathButton">
<Grid>
<Border x:Name="BorderVisual"
SnapsToDevicePixels="True"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}">
<!-- 核心:绑定矢量图形 -->
<Path x:Name="path"
Data="{Binding PathGeometry, RelativeSource={RelativeSource TemplatedParent}}"
Style="{Binding PathStyle, RelativeSource={RelativeSource TemplatedParent}}" />
</Border>
<!--Changed BorderBrush from "{telerik:Office2016Resource ResourceKey=AccentFocusedBrush}" to "#FF8080" -->
<Border x:Name="FocusVisual"
Opacity="0"
BorderThickness="{telerik:Office2016Resource ResourceKey=FocusThickness}"
BorderBrush="#5E9CF3"
SnapsToDevicePixels="True"
CornerRadius="{TemplateBinding CornerRadius}"/>
</Grid>
<ControlTemplate.Triggers>
<!-- background is hidden -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="True"/>
<Condition Property="IsBackgroundVisible" Value="False"/>
</MultiTrigger.Conditions>
<Setter TargetName="BorderVisual" Property="Background" Value="Transparent"/>
<Setter TargetName="BorderVisual" Property="BorderBrush" Value="Transparent"/>
</MultiTrigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<!--Changed Value from "{telerik:Office2016Resource ResourceKey=AccentMouseOverBrush}" to "#FF8080"-->
<Setter TargetName="BorderVisual" Property="Background" Value="#5E9CD3"/>
<Setter TargetName="BorderVisual" Property="BorderBrush" Value="#5E9CD3"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<!--Changed Value from "{telerik:Office2016Resource ResourceKey=AccentPressedBrush}" to "#FFE680"-->
<Setter TargetName="BorderVisual" Property="Background" Value="#5E9CD7"/>
<Setter TargetName="BorderVisual" Property="BorderBrush" Value="#5E9CD7 "/>
</Trigger>
<!-- hovered and focused -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsFocused" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="FocusVisual" Property="Opacity" Value="0"/>
</MultiTrigger>
<!-- pressed and focused -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsFocused" Value="True"/>
<Condition Property="IsPressed" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="FocusVisual" Property="Opacity" Value="0"/>
</MultiTrigger>
<!-- disabled -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False"/>
<Condition Property="IsBackgroundVisible" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="BorderVisual" Property="Background" Value="Transparent"/>
<Setter TargetName="BorderVisual" Property="BorderBrush" Value="#5d6b99"/>
<Setter TargetName="path" Property="Fill" Value="#1E3F66"/>
</MultiTrigger>
<!-- disabled and focused -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False"/>
<Condition Property="IsFocused" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="FocusVisual" Property="Opacity" Value="0"/>
</MultiTrigger>
<!-- disabled & background is hidden -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False"/>
<Condition Property="IsBackgroundVisible" Value="False"/>
</MultiTrigger.Conditions>
<Setter TargetName="BorderVisual" Property="Background" Value="Transparent"/>
<Setter TargetName="BorderVisual" Property="BorderBrush" Value="Transparent"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 树结构展开按钮样式 -->
<Style x:Key="ExpanderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="IsTabStop" Value="True" />
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Grid x:Name="ButtonOver" Opacity="0" Margin="0,4,0,0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="16" Height="16">
<Rectangle Stroke="#FF027BA6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" Height="Auto"
RadiusX="3" RadiusY="3">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF00BCFF" Offset="0" />
<GradientStop Color="#FF027BA6" Offset="1" />
<GradientStop Color="#FF00A5E0" Offset="0.5" />
<GradientStop Color="#FF005674" Offset="0.501" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle x:Name="CollapsedVisualOver"
HorizontalAlignment="Left" VerticalAlignment="Top"
Width="2" Height="8" RadiusX="0" RadiusY="0"
Fill="#FFFFFFFF" Margin="7,4,0,0" />
<Rectangle RadiusX="0" RadiusY="0" Fill="#FFFFFFFF"
HorizontalAlignment="Left" VerticalAlignment="Top"
Width="8" Height="2" Margin="4,7,0,0" />
</Grid>
<Grid x:Name="Button" Margin="0,6,5.5,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="10" Height="10">
<Rectangle Stroke="#ffc7defc" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" Height="Auto"
RadiusX="1" RadiusY="1" Fill="#ffc7defc">
</Rectangle>
<Rectangle x:Name="CollapsedVisual" HorizontalAlignment="Left"
VerticalAlignment="Top" Width="2" Height="6" RadiusX="0"
RadiusY="0" Fill="#FF3C6AA3" Margin="4,2,0,0" />
<Rectangle RadiusX="0" RadiusY="0" Fill="#FF3C6AA3"
HorizontalAlignment="Left" Margin="2,3.5,0,0"
VerticalAlignment="Top" Width="6" Height="2" />
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CollapsedVisualOver" Storyboard.TargetProperty="(UIElement.Opacity)" To="0"/>
<DoubleAnimation Storyboard.TargetName="CollapsedVisual" Storyboard.TargetProperty="(UIElement.Opacity)" To="0"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CollapsedVisualOver" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
<DoubleAnimation Storyboard.TargetName="CollapsedVisual" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 树结构节点默认展开样式设置 -->
<Style x:Key="ExpandedTreeViewItemStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="IsExpanded" Value="True"/>
</Style>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate1">
<ItemsControl ItemsSource="{Binding Index}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate1">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Index}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate2">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Terms}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Text="{Binding Term_No}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate2">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Terms}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Term_No}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate3">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding Wire_Tag}" TextAlignment="Center" Padding="4,2" Width="auto"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate3">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Wire_Tag}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate4">
<ItemsControl ItemsSource="{Binding Polaritys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding Polarity}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate4">
<ItemsControl ItemsSource="{Binding Polaritys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Polarity}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<telerik:RadBusyIndicator BusyContent="{Binding BusyContent}" IsBusy="{Binding IsBusy}">
<Grid >
<StackPanel>
<CustomControl:customWindowTitleBar/>
<Grid Background="#5d6b99">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="260" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Background="#5d6b99">
<!-- 按钮区域 -->
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="10,0,10,5">
<Line X1="0" Y1="1" X2="0" Y2="29" StrokeThickness="0.3" Stroke="Black"/>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe702;}"
ToolTip="新增位置"
Command="{Binding HeadButtonCmd}" CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe12e;}" x:Name="IconButton2"
ToolTip="新建端子排"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe649;}"
ToolTip="修改位置,端子排信息"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe10c;}"
ToolTip="删除节点"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<Line X1="0" Y1="1" X2="0" Y2="29" StrokeThickness="0.3" Stroke="Black"/>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe111;}"
ToolTip="选择位号关联通道"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe10f;}"
ToolTip="选择电缆关联通道"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe110;}"
ToolTip="解除电缆关联通道"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<Line X1="0" Y1="1" X2="0" Y2="29" StrokeThickness="0.3" Stroke="Black"/>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe12f;}"
ToolTip="新增端子排通道"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe681;}"
ToolTip="删除端子排通道"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
<telerik:RadPathButton.IsEnabled>
<MultiBinding Converter="{StaticResource SelectedItemToBoolConverter}">
<Binding ElementName="treeView1" Path="SelectedItem" />
<Binding RelativeSource="{RelativeSource Self}" Path="ToolTip" />
</MultiBinding>
</telerik:RadPathButton.IsEnabled>
</telerik:RadPathButton>
<Line X1="0" Y1="1" X2="0" Y2="29" StrokeThickness="0.3" Stroke="Black"/>
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe134;}"
ToolTip="导出端子排(模块)使用明细表"
Command="{Binding HeadButtonCmd}"
CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}">
</telerik:RadPathButton>
</StackPanel>
<Border Grid.Row="1" BorderThickness="1" >
<StackPanel>
<Border BorderThickness="0 0 0 1" Margin="10,0,0,0">
<TextBlock Text="端子排浏览" Foreground="White" />
</Border>
<!-- 左侧树形结构 -->
<Border>
<telerik:RadTreeView x:Name="treeView1" Height="660" Background="White"
IsLineEnabled="True" ExpanderStyle="{StaticResource ExpanderStyle}"
ItemsSource="{Binding PanelTreels}" SelectedItem="{Binding SelectedTreeNode,Mode=TwoWay}"
ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}"
PreviewMouseRightButtonDown="RadTreeView_PreviewMouseRightButtonDown"
Margin="5" telerik:StyleManager.Theme="Office_Blue" AllowDrop="True"
>
<telerik:RadTreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
<TextBlock Text="{Binding Text}">
</TextBlock>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
<TextBlock Text="{Binding Text}"/>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding PanelTreels}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Text}"/>
<TextBlock Text=" (" />
<TextBlock Text="{Binding NodeExtData.ChannelsSpared}" FontWeight="Bold" />
<TextBlock Text=")" />
</StackPanel>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</telerik:RadTreeView.ItemTemplate>
<telerik:RadTreeView.ContextMenu>
<ContextMenu x:Name="TreeItemContextMenu">
<!-- 菜单项将会在后台动态填充 -->
</ContextMenu>
</telerik:RadTreeView.ContextMenu>
</telerik:RadTreeView>
</Border>
</StackPanel>
</Border>
</StackPanel>
<StackPanel Grid.Column="2" Margin="0,0,5,20" Background="#5d6b99">
<!-- 按钮区域 -->
<DockPanel Margin="0,0,0,0">
<telerik:RadPathButton PathGeometry="{telerik:RadGlyph Glyph=&#xe649;}"
ToolTip="端子排模版设置" Padding="0"
Command="{Binding HeadButtonCmd}" CommandParameter="{Binding ToolTip,RelativeSource={RelativeSource Self}}"/>
<telerik:RadButton Content="上移通道(L)" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="下移通道(D)" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="迁移通道(M)" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="锁定通道(L)" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="解锁通道(L)" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="关联信号" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" IsEnabled="{Binding IsEnabledASButton}" Margin="5">
</telerik:RadButton>
<telerik:RadButton Content="解除信号" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" IsEnabled="{Binding IsEnabledClearButton}" Margin="5"/>
<telerik:RadButton Content="母线详情" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="批量分配" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5"/>
<telerik:RadButton Content="保存" HorizontalAlignment="Right" Width="50" Command="{Binding TableButtonCmd}" CommandParameter="{Binding Content,RelativeSource={RelativeSource Self}}" Margin="5,5,0,5"/>
</DockPanel>
<Border BorderThickness="0 0 0 1">
<TextBlock Text="通道详细信息" Foreground="White" />
</Border>
<!-- 数据表格 -->
<Grid>
<telerik:RadGridView x:Name="RadGridView1" SelectionMode="Single" Width="auto" Height="660"
AutoGenerateColumns="False" IsFilteringAllowed="False"
IsReadOnly="False" RowIndicatorVisibility="Collapsed"
ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Blue"
ItemsSource="{Binding ChannelInfos}" SelectedItem="{Binding SelectedChannelInfo, Mode=TwoWay}"
>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="序号" CellTemplate="{StaticResource CellTemplate1}" CellStyle="{StaticResource CellTyle1}" IsReadOnly="True"/>
<telerik:GridViewDataColumn Header="通道号" DataMemberBinding="{Binding ChannelNumber}"
IsCellMergingEnabled="True"/>
<telerik:GridViewDataColumn Header="端子号" CellTemplate="{StaticResource CellTemplate2}" CellEditTemplate="{StaticResource CellEditTemplate2}"/>
<telerik:GridViewDataColumn Header="占用人" DataMemberBinding="{Binding Occupant}" IsReadOnly="True"/>
<telerik:GridViewDataColumn Header="电缆位号" DataMemberBinding="{Binding CableTag}" IsReadOnly="True" Width="100">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding CableTag}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding CableTag}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="电缆对" DataMemberBinding="{Binding CablePair}"/>
<telerik:GridViewDataColumn Header="电缆线号" CellTemplate="{StaticResource CellTemplate3}" CellEditTemplate="{StaticResource CellEditTemplate3}"/>
<telerik:GridViewDataColumn Header="极性" CellTemplate="{StaticResource CellTemplate4}" CellEditTemplate="{StaticResource CellEditTemplate4}"/>
<telerik:GridViewDataColumn Header="信号名称" DataMemberBinding="{Binding SignalName}"/>
<telerik:GridViewDataColumn Header="信号组别" DataMemberBinding="{Binding GroupOther}" IsReadOnly="True"/>
<telerik:GridViewDataColumn Header="信号编码" DataMemberBinding="{Binding SignalCode}" IsReadOnly="True"/>
<telerik:GridViewDataColumn Header="中文描述" DataMemberBinding="{Binding ChineseDescription}" Width="120">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ChineseDescription}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding ChineseDescription}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="英文描述" DataMemberBinding="{Binding EnglishDescription}" Width="120">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding EnglishDescription}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding EnglishDescription}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="信号类型" DataMemberBinding="{Binding SignalType}"
Width="*"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</telerik:RadBusyIndicator>
</UserControl>