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

111 lines
7.2 KiB
XML

<UserControl x:Class="SWS.CAD.Views.Dialog.DialogBusbarManagement"
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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SWS.CAD;component/Views/Style/CustomStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel Background="#5d6b99">
<local:customWindowTitleBar />
<Grid Margin="6" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Text="母线:" Foreground="White"/>
<ComboBox ItemsSource="{Binding BusbarDropDownList}"
SelectedItem="{Binding SelectBusbarValue ,Mode=TwoWay}"
DisplayMemberPath="TagNumber" Width="140">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding Busbarcmd}"
CommandParameter="{Binding EventArgs}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<telerik:RadGridView Name="RadGridView1"
Grid.Row="2"
telerik:StyleManager.Theme="Office_Blue"
AutoGenerateColumns="False" IsFilteringAllowed="False"
IsReadOnly="{Binding IsReadOnly,Mode=TwoWay}" RowIndicatorVisibility="Collapsed"
ItemsSource="{Binding SignalInfos,Mode=TwoWay}"
SelectedItem="{Binding SelectedSignalInfo}"
ShowGroupPanel="False"
Width="600" Height="300">
<i:Interaction.Triggers>
<i:EventTrigger EventName="CellEditEnded">
<i:InvokeCommandAction Command="{Binding EditEndCmd}"
CommandParameter="{Binding EventArgs}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Index}" IsReadOnly="True" Header="序号">
<telerik:GridViewDataColumn.CellStyle>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="Background" Value="#5d6b99" />
<Setter Property="Foreground" Value="White" />
</Style>
</telerik:GridViewDataColumn.CellStyle>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Group_Name}" IsReadOnly="True" Header="信号名称">
<telerik:GridViewDataColumn.CellStyle>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="Background" Value="#5d6b99" />
<Setter Property="Foreground" Value="White" />
</Style>
</telerik:GridViewDataColumn.CellStyle>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding GroupOther}" Header="信号组别"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Signal_SeqNo}" Header="信号编号"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Group_Desc}" Header="中文描述" Width="150" HeaderTextAlignment="Center" >
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Group_Desc}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Group_Desc}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Group_Desc_EN}" Header="英文描述" Width="150" HeaderTextAlignment="Center" >
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Group_Desc_EN}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Group_Desc_EN}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding IoType}" Header="信号类型" Width="*" HeaderTextAlignment="Center"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</StackPanel>
<StackPanel Grid.Column="1">
<telerik:RadButton Width="80" Margin="0 0 0 6" HorizontalAlignment="Right" Content="确定"
Command="{Binding OKCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />
<telerik:RadButton Width="80" Margin="0 0 0 6" HorizontalAlignment="Right" Content="取消"
Command="{Binding CloseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />
<telerik:RadButton Width="80" Margin="0 0 0 6" HorizontalAlignment="Right" Content="新增"
Command="{Binding NewCom}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />
<telerik:RadButton Width="80" Margin="0 0 0 6" HorizontalAlignment="Right" Content="删除"
Command="{Binding DeleteCom}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />
</StackPanel>
</Grid>
</StackPanel>
</UserControl>