299 lines
21 KiB
XML
299 lines
21 KiB
XML
<UserControl x:Class="SWS.CAD.Views.Dialog.DialogNewComponent"
|
|
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"
|
|
xmlns:uc="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>
|
|
<telerik:StringToGlyphConverter x:Key="StringToGlyphConverter1" />
|
|
<!-- 树结构展开按钮样式 -->
|
|
<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.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="10"/>
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0">
|
|
<Grid Width="300" Height="500" Background="#2d3135">
|
|
<!-- 左侧树形结构 -->
|
|
<Border>
|
|
<telerik:RadTreeView x:Name="treeView1" Height="660" Background="Transparent" Foreground="White"
|
|
IsLineEnabled="True" ExpanderStyle="{StaticResource ExpanderStyle}"
|
|
ItemsSource="{Binding TreeNodes}" SelectedItem="{Binding SelectedTreeNode,Mode=TwoWay}"
|
|
ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}"
|
|
Margin="5" telerik:StyleManager.Theme="Office_Blue" AllowDrop="True"
|
|
>
|
|
<telerik:RadTreeView.ItemTemplate>
|
|
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<telerik:RadGlyph FontSize="16" Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" Foreground="White"/>
|
|
<TextBlock Text="{Binding Text}"/>
|
|
</StackPanel>
|
|
<HierarchicalDataTemplate.ItemTemplate>
|
|
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<telerik:RadGlyph FontSize="16" Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" Foreground="White"/>
|
|
<TextBlock Text="{Binding Text}"/>
|
|
</StackPanel>
|
|
<HierarchicalDataTemplate.ItemTemplate>
|
|
<HierarchicalDataTemplate ItemsSource="{Binding PanelTreels}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<telerik:RadGlyph FontSize="16" Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" Foreground="White"/>
|
|
<TextBlock Text="{Binding Text}" FontWeight="Bold"/>
|
|
</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>
|
|
</Grid>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2">
|
|
<Grid Width="300" Height="500" Background="#2d3135">
|
|
<Grid IsEnabled="True">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="0" />
|
|
<RowDefinition Height="25" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<!--
|
|
<TextBlock Grid.Row="0"
|
|
Margin="2,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
Text="属性区" />
|
|
-->
|
|
<!--
|
|
<TextBox Grid.Row="1"
|
|
Margin="10,0,0,0" Width="200" Height="16" Visibility="{Binding PropertyVisibility}"
|
|
HorizontalAlignment="Left" Foreground="DeepPink"
|
|
VerticalAlignment="Center" BorderBrush="Black" BorderThickness="1"
|
|
Background="Transparent" IsReadOnly="True"
|
|
Text="{Binding objectTypeName}" />
|
|
-->
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" >
|
|
<Button Margin="10,0,0,0" Command="{Binding Command_Qiehuan}" BorderBrush="{x:Null}" BorderThickness="0"
|
|
ToolTip="切换属性视图" Width="18" Height="18">
|
|
<Button.Background>
|
|
<ImageBrush ImageSource="{Binding qiehuanImage}" Stretch="Fill"/>
|
|
</Button.Background>
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border BorderBrush="White" BorderThickness="1">
|
|
<Image Source="{Binding qiehuanImage}" Stretch="Fill"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button Margin="10,0,0,0" Command="{Binding Command_History}" BorderBrush="{x:Null}" BorderThickness="0"
|
|
IsEnabled="{Binding isEnabledHistory}" ToolTip="查看属性修改历史" Width="20" Height="20">
|
|
<Button.Background>
|
|
<ImageBrush ImageSource="{Binding historyImage}" Stretch="Fill"/>
|
|
</Button.Background>
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border BorderBrush="White" BorderThickness="1">
|
|
<Image Source="{Binding historyImage}" Stretch="Fill"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border BorderBrush="Black" BorderThickness="0">
|
|
<Image Source="{Binding history2Image}" Stretch="Fill"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button Margin="10,0,0,0" Command="{Binding Command_Lock}" BorderBrush="{x:Null}" BorderThickness="0"
|
|
IsEnabled="{Binding isEnabledLock}" ToolTip="{Binding lockTooltip}" Width="20" Height="20">
|
|
<Button.Background>
|
|
<ImageBrush ImageSource="{Binding lockImage}" Stretch="Fill"/>
|
|
</Button.Background>
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border BorderBrush="White" BorderThickness="1">
|
|
<Image Source="{Binding lockImage}" Stretch="Fill"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border BorderBrush="Black" BorderThickness="0">
|
|
<Image Source="{Binding lock2Image}" Stretch="Fill"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<telerik:RadComboBox
|
|
Width="160" Height="20" Margin="10,0,0,0"
|
|
DisplayMemberPath="objectDisplayName"
|
|
ItemsSource="{Binding listObjects,Mode=TwoWay}"
|
|
SelectedItem="{Binding SelectObject,Mode=TwoWay}"
|
|
Style="{StaticResource sysCombobox}" />
|
|
</StackPanel>
|
|
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
|
<Grid x:Name="gridBasic" IsEnabled="{Binding isEnabledGridProterty}">
|
|
<Grid >
|
|
<uc:PropertyGrid ShowProp="{Binding listShowProperty,Mode=TwoWay}" Background="Transparent"
|
|
IsBasicGroup="{Binding isBasicGroup,Mode=TwoWay}" CurrentPropertyName="{Binding CurrentPropertyName,Mode=TwoWay}"
|
|
HorizontalAlignment="Left" Height="auto" Margin="1" VerticalAlignment="Top" Width="270"/>
|
|
</Grid>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Grid.Row="1">
|
|
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<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="10 0 0 6" HorizontalAlignment="Right" Content="取消"
|
|
Command="{Binding CloseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</StackPanel>
|
|
</UserControl>
|