154 lines
10 KiB
XML
154 lines
10 KiB
XML
<UserControl x:Class="SWS.CAD.Views.Dialog.DialogChannelMigration"
|
|
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>
|
|
<!-- 树结构展开按钮样式 -->
|
|
<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>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<StackPanel Background="#5d6b99">
|
|
<local:customWindowTitleBar />
|
|
<Grid Margin="6" >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="9*"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel>
|
|
<GroupBox Margin="0" Header="端子排选择" Width="450" Foreground="White">
|
|
<telerik:RadTreeView x:Name="treeView1" Height="200" Background="White" Foreground="Black"
|
|
IsLineEnabled="True" ExpanderStyle="{StaticResource ExpanderStyle}"
|
|
ItemsSource="{Binding PanelTreels}" SelectedItem="{Binding SelectedTreeNode,Mode=TwoWay}"
|
|
ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}"
|
|
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>
|
|
</GroupBox>
|
|
<GroupBox Margin="0" Header="通道选择" Foreground="White">
|
|
<telerik:RadListBox x:Name="RadListBox" Height="150"
|
|
Margin="0" ItemsSource="{Binding Channels}"
|
|
SelectedItem="{Binding SelectedChannel,Mode=TwoWay}"
|
|
DisplayMemberPath="ChannelName"
|
|
IsTextSearchEnabled="True"
|
|
TextSearchMode="Contains"
|
|
SelectionMode="Single"/>
|
|
</GroupBox>
|
|
</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}}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</StackPanel>
|
|
</UserControl>
|