EPLAN_PROD_Plugin/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml

121 lines
5.5 KiB
XML

<hc:GlowWindow
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.LayoutHelperWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
Title="布线助手"
Width="450"
Height="260"
MinWidth="450"
MinHeight="260"
d:DataContext="{d:DesignInstance Type=viewmodel:LayoutHelperViewModel}"
ActiveGlowColor="{DynamicResource PrimaryColor}"
Background="White"
Left="1460"
Loaded="GlowWindow_Loaded"
Top="770"
WindowStartupLocation="Manual"
mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}">
<Grid Margin="2">
<Grid.RowDefinitions>
<RowDefinition Height="15" />
<RowDefinition Height="30" />
<RowDefinition Height="*" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<hc:SimpleStackPanel Grid.Row="0" Orientation="Horizontal">
<!--<TextBlock FontSize="14" TextWrapping="Wrap">
<Run Text="选中的电机:" />
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectMotorModel}" />
</TextBlock>-->
<TextBlock
Margin="0,0,0,0"
FontSize="14"
TextWrapping="Wrap">
<Run Text="当前布线的电机:" />
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding Motor.MotorModelStr}" />
<Run Text=" " />
<Run Text="轴号:" />
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.AxisNo}" />
</TextBlock>
</hc:SimpleStackPanel>
<StackPanel Grid.Row="1" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center" FontSize="14">
<Run Text="当前线段:" />
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.CableConnectionClass}" />
<Run Text=" " />
<Run Text="当前线类型:" />
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.CableType}" />
</TextBlock>
</StackPanel>
<ListView
Grid.Row="2"
hc:GridViewAttach.ColumnHeaderHeight="10"
ItemsSource="{Binding SubLines}"
Style="{StaticResource ListView.Small}">
<ListView.View>
<GridView>
<GridViewColumn
Width="80"
DisplayMemberBinding="{Binding CableType}"
Header="线类型" />
<GridViewColumn Header="线型号">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox IsReadOnly="True" Text="{Binding CableModel}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<hc:SimpleStackPanel Grid.Row="3">
<TextBlock TextWrapping="Wrap">
<Run Text="选中的线:" />
</TextBlock>
<TextBlock>
<Run Text="{Binding SelectLineName}" />
</TextBlock>
</hc:SimpleStackPanel>
<hc:SimpleStackPanel Grid.Row="4" VerticalAlignment="Bottom">
<DockPanel HorizontalAlignment="Stretch">
<Button
Click="PrevBtn_Click"
Content="上一根线"
DockPanel.Dock="Left"
IsEnabled="{Binding HasPrev}"
Style="{StaticResource ButtonDanger}" />
<Button
HorizontalAlignment="Right"
Click="NextBtn_Click"
Content="下一根线"
DockPanel.Dock="Right"
IsEnabled="{Binding HasNext}"
Style="{StaticResource ButtonPrimary}" />
<Button DockPanel.Dock="Right" Style="{StaticResource ButtonSuccess}">
<TextBlock>
<Run Text="{Binding SelectedLine.AxisNo}" />
<Run Text="-" />
<Run Text="{Binding SelectedLine.CurrentLine}" />
</TextBlock>
</Button>
</DockPanel>
</hc:SimpleStackPanel>
</Grid>
</Border>
</hc:GlowWindow>