510 lines
28 KiB
XML
510 lines
28 KiB
XML
<UserControl
|
|
x:Class="SWS.CAD.Views.LeftPanel"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:Behaviors="clr-namespace:SWS.Commons.Helper.Behaviours;assembly=SWS.Commons"
|
|
xmlns:converter="clr-namespace:SWS.CAD.Converter"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:SWS.CAD.Views"
|
|
xmlns:local2="clr-namespace:SWS.Model;assembly=SWS.Model"
|
|
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
|
Width="250"
|
|
Loaded="UserControl_Loaded">
|
|
|
|
|
|
<UserControl.Resources>
|
|
<converter:ImageSourceConverter x:Key="imgConverter" />
|
|
<converter:ExpandConverter x:Key="expandConverter" />
|
|
<DataTemplate x:Key="Team">
|
|
<TextBlock Text="{Binding Text}" />
|
|
</DataTemplate>
|
|
<!--<HierarchicalDataTemplate x:Key="Division" ItemsSource="{Binding ChildNodes}">
|
|
<TextBlock Text="{Binding Text}">
|
|
<telerik:RadContextMenu.ContextMenu>
|
|
<telerik:RadContextMenu Opened="RadContextMenu_Opened">
|
|
<telerik:RadMenuItem Header="打开" />
|
|
</telerik:RadContextMenu>
|
|
</telerik:RadContextMenu.ContextMenu>
|
|
</TextBlock>
|
|
</HierarchicalDataTemplate>-->
|
|
<!--<local:DrawingSelector
|
|
x:Key="drawingSelector"
|
|
DivisionTemplate="{StaticResource Division}"
|
|
TeamTemplate="{StaticResource Team}" />-->
|
|
<telerik:StringToGlyphConverter x:Key="StringToGlyphConverter1" />
|
|
|
|
<!-- 系统textbox -->
|
|
<Style x:Key="sysTextBox" TargetType="TextBox">
|
|
<Setter Property="Height" Value="24" />
|
|
<Setter Property="Margin" Value="5,0,5,0" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
<!-- 右键菜单用的样式 -->
|
|
<Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem">
|
|
|
|
<Setter Property="Header" Value="{Binding Header}" />
|
|
<Setter Property="Command" Value="{Binding Command}" />
|
|
<Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Mode=Self}}" />
|
|
</Style>
|
|
<!-- ListBox样式 -->
|
|
<ItemsPanelTemplate x:Key="StackPanelItemsPanel">
|
|
<VirtualizingStackPanel Orientation="Vertical" />
|
|
</ItemsPanelTemplate>
|
|
<ItemsPanelTemplate x:Key="VirtualizingWrapPanelItemsPanel">
|
|
<telerik:VirtualizingWrapPanel ItemHeight="70" ItemWidth="70" />
|
|
</ItemsPanelTemplate>
|
|
<DataTemplate x:Key="VirtualizingWrapPanelItemTemplate">
|
|
<Grid ToolTip="{Binding LibraryFileName}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0" Background="Gray">
|
|
<Image
|
|
Width="auto"
|
|
Height="auto"
|
|
HorizontalAlignment="Stretch"
|
|
Source="{Binding ImagePath, Converter={StaticResource imgConverter}}"
|
|
Stretch="Fill" />
|
|
|
|
</Grid>
|
|
<TextBlock
|
|
Grid.Row="1"
|
|
Margin="2,0,0,0"
|
|
VerticalAlignment="Bottom"
|
|
FontFamily="Segoe UI"
|
|
FontSize="12"
|
|
Text="{Binding LibraryFileName}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</UserControl.Resources>
|
|
|
|
<Grid IsEnabled="{Binding LoginOK}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="16" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock
|
|
Margin="2,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Background="Gray"
|
|
Text="{Binding curProjName}" />
|
|
<telerik:RadTabControl
|
|
Grid.Row="1"
|
|
Margin="0,0,-5,0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
telerik:StyleManager.Theme="Expression_Dark"
|
|
BorderThickness="1"
|
|
SelectionChanged="RadTabControl_SelectionChanged"
|
|
TabStripPlacement="Right">
|
|
<!-- 自定义Tab Header的模板 -->
|
|
<telerik:RadTabControl.ItemContainerStyle>
|
|
<Style TargetType="telerik:RadTabItem">
|
|
<Setter Property="HeaderTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate>
|
|
<TextBlock
|
|
Width="12"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="12"
|
|
Text="{Binding}">
|
|
<!-- 垂直旋转文本 -->
|
|
<TextBlock.LayoutTransform>
|
|
<RotateTransform Angle="270" />
|
|
</TextBlock.LayoutTransform>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</telerik:RadTabControl.ItemContainerStyle>
|
|
<!-- Tab 1: 工程文件 -->
|
|
<telerik:RadTabItem Header="工
程
文
件">
|
|
<TabControl Background="Transparent">
|
|
<TabItem Header="文件目录">
|
|
|
|
<Grid Background="Transparent">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="18" />
|
|
<RowDefinition Height="18" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<telerik:RadGlyph Grid.Column="0" Glyph="" />
|
|
<TextBox
|
|
Grid.Column="1"
|
|
Width="auto"
|
|
Margin="1,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
Style="{StaticResource sysTextBox}"
|
|
Tag="工程文件"
|
|
TextChanged="TextBox_TextChanged" />
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal">
|
|
<telerik:RadGlyph
|
|
FontSize="10"
|
|
Foreground="Yellow"
|
|
Glyph="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="10"
|
|
Foreground="Yellow"
|
|
Text="未检出"
|
|
TextAlignment="Center" />
|
|
<telerik:RadGlyph
|
|
FontSize="10"
|
|
Foreground="LightBlue"
|
|
Glyph="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="10"
|
|
Foreground="LightBlue"
|
|
Text="自己检出"
|
|
TextAlignment="Center" />
|
|
<telerik:RadGlyph
|
|
FontSize="10"
|
|
Foreground="LightPink"
|
|
Glyph="" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="10"
|
|
Foreground="LightPink"
|
|
Text="别人检出"
|
|
TextAlignment="Center" />
|
|
</StackPanel>
|
|
|
|
<TreeView
|
|
x:Name="radTreeView"
|
|
Grid.Row="2"
|
|
Grid.ColumnSpan="2"
|
|
Margin="-5,0,0,0"
|
|
Behaviors:TreeViewSelectedItemBehavior.SelectedItem="{Binding selectedNode, Mode=TwoWay}"
|
|
Background="Transparent"
|
|
FontSize="11"
|
|
ItemsSource="{Binding Drawings}"
|
|
PreviewMouseRightButtonDown="RadTreeView_PreviewMouseRightButtonDown">
|
|
<TreeView.ItemTemplate>
|
|
<HierarchicalDataTemplate DataType="{x:Type local2:TreeModel}" ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel
|
|
Height="16"
|
|
Orientation="Horizontal"
|
|
ToolTip="{Binding ToolTipText}">
|
|
<!-- 图标 -->
|
|
<telerik:RadGlyph
|
|
FontSize="16"
|
|
Foreground="{Binding FontColor}"
|
|
Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" />
|
|
<!-- 文本 -->
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Foreground="{Binding FontColor}"
|
|
Text="{Binding Text}" />
|
|
</StackPanel>
|
|
</HierarchicalDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
|
|
<TreeView.ContextMenu>
|
|
<ContextMenu x:Name="TreeItemContextMenu">
|
|
<!-- 菜单项将会在后台动态填充 -->
|
|
</ContextMenu>
|
|
</TreeView.ContextMenu>
|
|
</TreeView>
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="历史版次">
|
|
<Grid Background="Transparent">
|
|
<TreeView
|
|
x:Name="treeDwgHistory"
|
|
Margin="-5,0,0,0"
|
|
Behaviors:TreeViewSelectedItemBehavior.SelectedItem="{Binding selectedHistoryDwg, Mode=TwoWay}"
|
|
Background="Transparent"
|
|
FontSize="11"
|
|
ItemsSource="{Binding historyDrawings}"
|
|
PreviewMouseRightButtonDown="treeDwgHistory_PreviewMouseRightButtonDown">
|
|
<TreeView.ItemContainerStyle>
|
|
<Style TargetType="telerik:RadTreeViewItem">
|
|
<Setter Property="IsExpanded" Value="{Binding isexpand, Mode=TwoWay, Converter={StaticResource expandConverter}}" />
|
|
</Style>
|
|
</TreeView.ItemContainerStyle>
|
|
<TreeView.ItemTemplate>
|
|
<HierarchicalDataTemplate DataType="{x:Type local2:TreeModel}" ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel
|
|
Height="16"
|
|
Orientation="Horizontal"
|
|
ToolTip="{Binding ToolTipText}">
|
|
<!-- 图标 -->
|
|
<telerik:RadGlyph
|
|
FontSize="16"
|
|
Foreground="{Binding FontColor}"
|
|
Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" />
|
|
<!-- 文本 -->
|
|
<TextBlock VerticalAlignment="Center" Text="{Binding Text}" />
|
|
</StackPanel>
|
|
</HierarchicalDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
|
|
<TreeView.ContextMenu>
|
|
<ContextMenu x:Name="treeDwgHistoryItemContextMenu">
|
|
<!-- 菜单项将会在后台动态填充 -->
|
|
</ContextMenu>
|
|
</TreeView.ContextMenu>
|
|
</TreeView>
|
|
</Grid>
|
|
</TabItem>
|
|
</TabControl>
|
|
|
|
</telerik:RadTabItem>
|
|
|
|
<!-- Tab 2: Placeholder Content -->
|
|
<telerik:RadTabItem Header="设
计
元
件">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="18" />
|
|
<RowDefinition Height="auto" MaxHeight="150" />
|
|
<RowDefinition Height="4*" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
|
<Button
|
|
Width="16"
|
|
Height="16"
|
|
Margin="10,0,0,0"
|
|
BorderBrush="{x:Null}"
|
|
BorderThickness="0"
|
|
Command="{Binding Command_Guanlian}"
|
|
IsEnabled="{Binding isEnabledGuanlian}"
|
|
ToolTip="元件关联图元">
|
|
<Button.Background>
|
|
<ImageBrush ImageSource="{Binding guanlianImage}" 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 guanlianImage}" 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 guanlian2Image}" Stretch="Fill" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
<telerik:RadGlyph
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Glyph="" />
|
|
<TextBox
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Width="auto"
|
|
Margin="1,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
Style="{StaticResource sysTextBox}"
|
|
TextChanged="TextBox_TextChanged" />
|
|
<telerik:RadListBox Grid.Row="1" Grid.ColumnSpan="2" />
|
|
<!-- 最近使用 -->
|
|
<TreeView
|
|
Grid.Row="2"
|
|
Grid.ColumnSpan="2"
|
|
Margin="-5,0,0,0"
|
|
Behaviors:TreeViewSelectedItemBehavior.SelectedItem="{Binding selectType, Mode=TwoWay}"
|
|
Background="Transparent"
|
|
FontSize="11"
|
|
ItemsSource="{Binding objectTypeTree}">
|
|
<TreeView.ItemTemplate>
|
|
<HierarchicalDataTemplate DataType="{x:Type local2:TreeModel}" ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel Height="16" Orientation="Horizontal">
|
|
<!-- 图标 -->
|
|
<telerik:RadGlyph
|
|
FontSize="16"
|
|
Foreground="{Binding FontColor}"
|
|
Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" />
|
|
<!-- 文本 -->
|
|
<TextBlock VerticalAlignment="Center" Text="{Binding Text}" />
|
|
</StackPanel>
|
|
</HierarchicalDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
</TreeView>
|
|
<Grid Grid.Row="3" Grid.ColumnSpan="2">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<!--<telerik:RadListBox Background="BurlyWood" />-->
|
|
<telerik:RadListBox
|
|
x:Name="tagListBox"
|
|
Grid.Row="2"
|
|
BorderThickness="0"
|
|
ItemTemplate="{StaticResource VirtualizingWrapPanelItemTemplate}"
|
|
ItemsPanel="{StaticResource VirtualizingWrapPanelItemsPanel}"
|
|
ItemsSource="{Binding listLibrary}"
|
|
SelectedItem="{Binding selectedTag, Mode=TwoWay}"
|
|
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
|
|
VirtualizingPanel.ScrollUnit="Pixel"
|
|
VirtualizingPanel.VirtualizationMode="Recycling">
|
|
<!--<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="MouseDoubleClick">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding Command_TagDoubleClick}"
|
|
CommandParameter="{Binding ElementName=tagListBox, Path=SelectedItem}"
|
|
PassEventArgsToCommand="True" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>-->
|
|
<telerik:EventToCommandBehavior.EventBindings>
|
|
<telerik:EventBinding
|
|
Command="{Binding Command_TagDoubleClick}"
|
|
CommandParameter="{Binding ElementName=tagListBox, Path=SelectedItem}"
|
|
EventName="MouseDoubleClick"
|
|
PassEventArgsToCommand="True" />
|
|
</telerik:EventToCommandBehavior.EventBindings>
|
|
<telerik:RadListBox.GroupStyle>
|
|
<GroupStyle>
|
|
<GroupStyle.HeaderTemplate>
|
|
<DataTemplate>
|
|
<StackPanel
|
|
Height="30"
|
|
Margin="2"
|
|
Background="LightBlue">
|
|
<TextBlock
|
|
Margin="10,3,0,0"
|
|
FontFamily="Segoe UI Light"
|
|
FontSize="16"
|
|
FontWeight="Bold"
|
|
Foreground="Black"
|
|
Text="{Binding LibraryFileName}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</GroupStyle.HeaderTemplate>
|
|
</GroupStyle>
|
|
</telerik:RadListBox.GroupStyle>
|
|
</telerik:RadListBox>
|
|
<Label
|
|
Grid.Column="1"
|
|
Width="23"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Background="BurlyWood"
|
|
Content="图
元
列
表"
|
|
DockPanel.Dock="Right" />
|
|
<!-- 选择区 -->
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</telerik:RadTabItem>
|
|
|
|
<!-- Tab 3: Placeholder Content -->
|
|
<telerik:RadTabItem Header="设
计
浏
览">
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBox
|
|
Width="auto"
|
|
Margin="1,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
Style="{StaticResource sysTextBox}"
|
|
Tag="设计浏览"
|
|
TextChanged="TextBox_TextChanged" />
|
|
<TreeView
|
|
x:Name="designTreeView"
|
|
Margin="-5,0,0,0"
|
|
Behaviors:TreeViewSelectedItemBehavior.SelectedItem="{Binding selectDesign, Mode=TwoWay}"
|
|
Background="Transparent"
|
|
FontSize="11"
|
|
ItemsSource="{Binding designTree}">
|
|
<!--<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding Common_SelectedDesign}"
|
|
CommandParameter="{Binding ElementName=designTreeView, Path=SelectedItem}"
|
|
PassEventArgsToCommand="True" />
|
|
</i:EventTrigger>
|
|
<i:EventTrigger EventName="MouseDoubleClick">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding Common_DoubleClickDesign}"
|
|
CommandParameter="{Binding ElementName=designTreeView, Path=SelectedItem}"
|
|
PassEventArgsToCommand="True" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>-->
|
|
<telerik:EventToCommandBehavior.EventBindings>
|
|
<telerik:EventBinding
|
|
Command="{Binding Common_SelectedDesign}"
|
|
CommandParameter="{Binding ElementName=designTreeView, Path=SelectedItem}"
|
|
EventName="SelectedItemChanged"
|
|
PassEventArgsToCommand="True" />
|
|
<telerik:EventBinding
|
|
Command="{Binding Common_DoubleClickDesign}"
|
|
CommandParameter="{Binding ElementName=designTreeView, Path=SelectedItem}"
|
|
EventName="MouseDoubleClick"
|
|
PassEventArgsToCommand="True" />
|
|
</telerik:EventToCommandBehavior.EventBindings>
|
|
<TreeView.ItemContainerStyle>
|
|
<Style TargetType="TreeViewItem">
|
|
<Setter Property="IsExpanded" Value="{Binding isexpand, Mode=TwoWay, Converter={StaticResource expandConverter}}" />
|
|
</Style>
|
|
</TreeView.ItemContainerStyle>
|
|
<TreeView.ItemTemplate>
|
|
<HierarchicalDataTemplate DataType="{x:Type local2:TreeModel}" ItemsSource="{Binding ChildNodes}">
|
|
<StackPanel
|
|
Height="16"
|
|
Orientation="Horizontal"
|
|
ToolTip="{Binding ToolTipText}">
|
|
<!-- 图标 -->
|
|
<telerik:RadGlyph
|
|
FontSize="16"
|
|
Foreground="{Binding FontColor}"
|
|
Glyph="{Binding Glyph, Converter={StaticResource StringToGlyphConverter1}}" />
|
|
<!-- 文本 -->
|
|
<TextBlock VerticalAlignment="Center" Text="{Binding Text}" />
|
|
</StackPanel>
|
|
</HierarchicalDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
</TreeView>
|
|
</StackPanel>
|
|
</telerik:RadTabItem>
|
|
|
|
<!-- Tab 4: Placeholder Content -->
|
|
<telerik:RadTabItem Header="Tab 4">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="16"
|
|
Text="This is Tab 4 content." />
|
|
</telerik:RadTabItem>
|
|
</telerik:RadTabControl>
|
|
</Grid>
|
|
</UserControl>
|