105040 Update 优化滚动效果
This commit is contained in:
parent
4be42fdc5c
commit
b7591e9cb2
|
|
@ -6,15 +6,19 @@
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
|
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:util="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Utils"
|
||||||
|
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
||||||
Title="CableLectotypeWindow"
|
Title="CableLectotypeWindow"
|
||||||
Width="800"
|
Width="1200"
|
||||||
Height="450"
|
Height="800"
|
||||||
|
d:DataContext="{d:DesignInstance Type=viewmodel:CableLectotypeViewModel}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
<util:ConnectionTypeConverter x:Key="ConnectionTypeConverter" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
@ -23,122 +27,320 @@
|
||||||
<RowDefinition Height="60" />
|
<RowDefinition Height="60" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="300" />
|
<ColumnDefinition Width="400" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<ScrollViewer
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Panel.ZIndex="99"
|
||||||
|
VerticalScrollBarVisibility="Hidden">
|
||||||
|
<StackPanel
|
||||||
|
x:Name="GrowlParent"
|
||||||
|
Margin="0,10,10,10"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Panel.ZIndex="99" />
|
||||||
|
</ScrollViewer>
|
||||||
<hc:Card
|
<hc:Card
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Effect="{DynamicResource EffectShadow2}">
|
Effect="{DynamicResource EffectShadow2}"
|
||||||
<hc:SimpleStackPanel Orientation="Vertical">
|
FontSize="14">
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
<hc:SimpleStackPanel
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="电机ID:" />
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="140"
|
VerticalAlignment="Center"
|
||||||
Height="30"
|
IsReadOnly="True"
|
||||||
Margin="5,0,0,0"
|
Style="{StaticResource TextBoxPlusBaseStyle}"
|
||||||
hc:TitleElement.Title="电机型号"
|
Text="{Binding Motor.OccPartId}" />
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
<hc:TextBox
|
|
||||||
Width="140"
|
|
||||||
Height="30"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
hc:TitleElement.Title="电机功率"
|
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="电机型号:" />
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="140"
|
Width="100"
|
||||||
Height="30"
|
VerticalAlignment="Center"
|
||||||
Margin="5,0,0,0"
|
IsReadOnly="True"
|
||||||
hc:TitleElement.Title="电机型号"
|
Style="{StaticResource TextBoxPlusBaseStyle}"
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
Text="{Binding Motor.MotorModelStr}" />
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center" Text="电机功率:" />
|
||||||
IsReadOnly="True" />
|
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="140"
|
Width="118"
|
||||||
Height="30"
|
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
hc:TitleElement.Title="电机功率"
|
VerticalAlignment="Center"
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
IsReadOnly="True"
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
Style="{StaticResource TextBoxPlusBaseStyle}"
|
||||||
IsReadOnly="True" />
|
Text="{Binding Motor.MotorPower}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:SimpleStackPanel Orientation="Vertical">
|
<hc:SimpleStackPanel
|
||||||
<hc:TextBox
|
Margin="0,10,0,0"
|
||||||
Width="240"
|
HorizontalAlignment="Stretch"
|
||||||
Height="30"
|
Orientation="Horizontal">
|
||||||
Margin="5,0,0,0"
|
<TextBlock
|
||||||
HorizontalAlignment="Left"
|
Width="100"
|
||||||
hc:TitleElement.Title="电机型号"
|
VerticalAlignment="Center"
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
Text="线材链接方式:" />
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
<hc:ButtonGroup Width="263" Style="{StaticResource ButtonGroupSolid}">
|
||||||
IsReadOnly="True" />
|
<RadioButton Content="直通" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static util:ConnectionType.Passthrough}}" />
|
||||||
<hc:TextBox
|
<RadioButton Content="全段" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static util:ConnectionType.FullParagraph}}" />
|
||||||
Width="240"
|
</hc:ButtonGroup>
|
||||||
Height="30"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
hc:TitleElement.Title="电机功率"
|
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:SimpleStackPanel Orientation="Vertical">
|
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="轴号:" />
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="240"
|
Width="263"
|
||||||
Height="30"
|
Height="30"
|
||||||
Margin="5,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
hc:TitleElement.Title="电机型号"
|
hc:TitleElement.TitleWidth="120"
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
Text="{Binding AxisNo, Mode=TwoWay}" />
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
<hc:TextBox
|
|
||||||
Width="240"
|
|
||||||
Height="30"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
hc:TitleElement.Title="电机型号"
|
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="线材类型:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
Width="263"
|
||||||
|
DisplayMemberPath="ItemName"
|
||||||
|
ItemsSource="{Binding CableTypes}"
|
||||||
|
SelectedIndex="0"
|
||||||
|
SelectedValue="{Binding CableType}"
|
||||||
|
SelectedValuePath="ItemValue" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<!--<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Vertical">
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Width="100" Text="编码器线长度:" VerticalAlignment="Center"/>
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="140"
|
Width="263"
|
||||||
Height="30"
|
Height="30" />
|
||||||
Margin="5,0,0,0"
|
</hc:SimpleStackPanel>
|
||||||
hc:TitleElement.Title="电机型号"
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
<TextBlock Width="100" Text="动力线长度:" VerticalAlignment="Center"/>
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
|
||||||
IsReadOnly="True" />
|
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
Width="140"
|
Width="263"
|
||||||
Height="30"
|
Height="30" />
|
||||||
Margin="5,0,0,0"
|
</hc:SimpleStackPanel>
|
||||||
hc:TitleElement.Title="电机功率"
|
</hc:SimpleStackPanel>-->
|
||||||
hc:TitleElement.TitlePlacement="Left"
|
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Vertical">
|
||||||
hc:TitleElement.VerticalAlignment="Center"
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
IsReadOnly="True" />
|
<TextBlock
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="编码器线段数:" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="263"
|
||||||
|
Height="30"
|
||||||
|
IsEnabled="{Binding IsEnableParagraph}"
|
||||||
|
IsReadOnly="False"
|
||||||
|
Text="{Binding EncoderLineParagraph, Mode=TwoWay}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="动力线段数:" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="263"
|
||||||
|
Height="30"
|
||||||
|
IsEnabled="{Binding IsEnableParagraph}"
|
||||||
|
IsReadOnly="False"
|
||||||
|
Text="{Binding PowerLineParagraph, Mode=TwoWay}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Margin="0,10" Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="型号:" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="233"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding CableModelStr}" />
|
||||||
|
<Button hc:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel>
|
||||||
|
<hc:ButtonGroup>
|
||||||
|
<Button
|
||||||
|
Background="{StaticResource LightPrimaryBrush}"
|
||||||
|
Content="查看图纸"
|
||||||
|
Foreground="{StaticResource PrimaryTextBrush}"
|
||||||
|
Style="{StaticResource ButtonGroupItemBaseStyle}" />
|
||||||
|
<Button
|
||||||
|
Background="{StaticResource LightPrimaryBrush}"
|
||||||
|
Content="查看BOM"
|
||||||
|
Foreground="{StaticResource PrimaryTextBrush}"
|
||||||
|
Style="{StaticResource ButtonGroupItemBaseStyle}" />
|
||||||
|
<Button
|
||||||
|
x:Name="CableratorBtn"
|
||||||
|
Background="{StaticResource LightPrimaryBrush}"
|
||||||
|
Click="CableratorBtn_Click"
|
||||||
|
Content="生成线材列表"
|
||||||
|
Foreground="{StaticResource PrimaryTextBrush}"
|
||||||
|
Style="{StaticResource ButtonGroupItemBaseStyle}" />
|
||||||
|
</hc:ButtonGroup>
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
|
<hc:Card
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Effect="{DynamicResource EffectShadow2}">
|
||||||
|
|
||||||
|
<DataGrid
|
||||||
|
MinHeight="200"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
Background="{StaticResource BackgroundBrush}"
|
||||||
|
CanUserAddRows="False"
|
||||||
|
FontSize="14"
|
||||||
|
ItemsSource="{Binding SelectedLines}"
|
||||||
|
RowDetailsVisibilityMode="Visible"
|
||||||
|
RowHeight="NaN"
|
||||||
|
ScrollViewer.CanContentScroll="False"
|
||||||
|
VirtualizingPanel.ScrollUnit="Pixel">
|
||||||
|
<DataGrid.RowStyle>
|
||||||
|
<Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
<Setter Property="Background" Value="#18a05d" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding DrawingNo}" Value="">
|
||||||
|
<Setter Property="Background" Value="#dc4d41" />
|
||||||
|
</DataTrigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="#88326cf3" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
<DataGrid.CellStyle>
|
||||||
|
<Style BasedOn="{StaticResource DataGridCellStyle}" TargetType="DataGridCell">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="Foreground" Value="Black" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.CellStyle>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="Auto"
|
||||||
|
Binding="{Binding SeqNo}"
|
||||||
|
Header="序号" />
|
||||||
|
<DataGridTextColumn Binding="{Binding AxisNo}" Header="轴号" />
|
||||||
|
<DataGridTextColumn Binding="{Binding CurrentLine}" Header="段" />
|
||||||
|
<DataGridTextColumn Binding="{Binding CableType}" Header="线类型" />
|
||||||
|
<DataGridTextColumn Binding="{Binding CableConnectionClass}" Header="连接类型" />
|
||||||
|
<DataGridTemplateColumn Header="是否高柔">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsChecked="{Binding IsFlexibility, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
IsEnabled="True" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn Binding="{Binding DrawingNo}" Header="图号" />
|
||||||
|
<DataGridTemplateColumn Width="300" Header="操作">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel MinWidth="300" Orientation="Horizontal">
|
||||||
|
<Button Content="查看图纸" />
|
||||||
|
<Button Margin="10,0,0,0" Content="查看BOM" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Header="是否布线完成">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsChecked="{Binding IsComplete, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
IsEnabled="True" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Binding="{Binding CableModelNo}"
|
||||||
|
Header="型号"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
<DataGrid.RowDetailsTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ListView
|
||||||
|
Margin="30,0,0,0"
|
||||||
|
hc:BorderElement.CornerRadius="0"
|
||||||
|
BorderBrush="LightGray"
|
||||||
|
BorderThickness="2,0,2,2"
|
||||||
|
ItemsSource="{Binding SubLines}"
|
||||||
|
PreviewMouseWheel="ListView_PreviewMouseWheel"
|
||||||
|
ScrollViewer.CanContentScroll="True"
|
||||||
|
SelectionMode="Single"
|
||||||
|
VirtualizingPanel.ScrollUnit="Pixel">
|
||||||
|
<ListView.View>
|
||||||
|
<GridView>
|
||||||
|
<!--<GridViewColumn DisplayMemberBinding="{Binding SeqNo}" Header="序号" />-->
|
||||||
|
<GridViewColumn
|
||||||
|
Width="100"
|
||||||
|
DisplayMemberBinding="{Binding CableType}"
|
||||||
|
Header="线类型" />
|
||||||
|
<!--<GridViewColumn DisplayMemberBinding="{Binding CableModel}" Header="可用的线型号" />-->
|
||||||
|
<GridViewColumn Width="420" Header="可用的线型号">
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<hc:TextBox
|
||||||
|
MinWidth="400"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding CableModel}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGrid.RowDetailsTemplate>
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
</hc:Card>
|
||||||
<hc:SimpleStackPanel
|
<hc:SimpleStackPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2">
|
Grid.ColumnSpan="2"
|
||||||
<TextBlock
|
HorizontalAlignment="Right"
|
||||||
HorizontalAlignment="Center"
|
Orientation="Horizontal">
|
||||||
VerticalAlignment="Center"
|
<Button
|
||||||
FontSize="20"
|
Margin="10,0,0,0"
|
||||||
Text="Hello World!" />
|
hc:IconElement.Geometry="{StaticResource DialogBoxLauncherGeometry}"
|
||||||
|
Content="置顶显示"
|
||||||
|
FontSize="14"
|
||||||
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
|
<Button
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
hc:IconElement.Geometry="{StaticResource SaveGeometry}"
|
||||||
|
Content="保存"
|
||||||
|
FontSize="14"
|
||||||
|
Style="{StaticResource ButtonPrimary}" />
|
||||||
|
<Button
|
||||||
|
Margin="10,0,10,0"
|
||||||
|
hc:IconElement.Geometry="{StaticResource CloseGeometry}"
|
||||||
|
Content="关闭"
|
||||||
|
FontSize="14"
|
||||||
|
Style="{StaticResource ButtonDanger}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:Card Grid.Row="0" Grid.Column="1">
|
|
||||||
<ListView />
|
|
||||||
</hc:Card>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,38 @@
|
||||||
using System;
|
using HandyControl.Controls;
|
||||||
using System.Collections.Generic;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
using System.Linq;
|
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CableLectotypeWindow.xaml 的交互逻辑
|
/// CableLectotypeWindow.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class CableLectotypeWindow : Window
|
public partial class CableLectotypeWindow : System.Windows.Window
|
||||||
{
|
{
|
||||||
public CableLectotypeWindow()
|
private MotorModel _motor;
|
||||||
|
private CableLectotypeViewModel ViewModel;
|
||||||
|
public CableLectotypeWindow(MotorModel motor)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_motor = motor;
|
||||||
|
this.DataContext = ViewModel = new CableLectotypeViewModel(motor);
|
||||||
|
Growl.Register("CableLectotypeMessage", GrowlParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CableratorBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Cablerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||||
|
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||||
|
eventArg.Source = sender;
|
||||||
|
(sender as ListView).RaiseEvent(eventArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,7 @@
|
||||||
BorderBrush="Gray"
|
BorderBrush="Gray"
|
||||||
BorderThickness="2,0,0,0"
|
BorderThickness="2,0,0,0"
|
||||||
ItemsSource="{Binding SubLines}"
|
ItemsSource="{Binding SubLines}"
|
||||||
|
PreviewMouseWheel="ListView_PreviewMouseWheel"
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||||
SelectionChanged="SubDetailsDataGrid_SelectionChanged"
|
SelectionChanged="SubDetailsDataGrid_SelectionChanged"
|
||||||
SelectionMode="Single">
|
SelectionMode="Single">
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Forms.Integration;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Sinvo.EplanHpD.Plugin.WPFUI
|
namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||||||
{
|
{
|
||||||
|
|
@ -357,7 +359,21 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||||||
|
|
||||||
private void MotorDataGridToCableLectotype_Click(object sender, RoutedEventArgs e)
|
private void MotorDataGridToCableLectotype_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
new CableLectotypeWindow().Show();
|
if (MotorDataGrid.SelectedItem != null)
|
||||||
|
{
|
||||||
|
var window = new CableLectotypeWindow(MotorDataGrid.SelectedItem as MotorModel);
|
||||||
|
ElementHost.EnableModelessKeyboardInterop(window);
|
||||||
|
window.Show();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||||
|
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||||
|
eventArg.Source = sender;
|
||||||
|
(sender as ListView).RaiseEvent(eventArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue