diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml
index 49a7c43..e1acc3e 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml
@@ -6,15 +6,19 @@
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:util="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Utils"
+ xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
Title="CableLectotypeWindow"
- Width="800"
- Height="450"
+ Width="1200"
+ Height="800"
+ d:DataContext="{d:DesignInstance Type=viewmodel:CableLectotypeViewModel}"
mc:Ignorable="d">
+
@@ -23,122 +27,320 @@
-
+
+
+
+
-
-
+ Effect="{DynamicResource EffectShadow2}"
+ FontSize="14">
+
+
+
-
+ VerticalAlignment="Center"
+ IsReadOnly="True"
+ Style="{StaticResource TextBoxPlusBaseStyle}"
+ Text="{Binding Motor.OccPartId}" />
-
+
+
+ Width="100"
+ VerticalAlignment="Center"
+ IsReadOnly="True"
+ Style="{StaticResource TextBoxPlusBaseStyle}"
+ Text="{Binding Motor.MotorModelStr}" />
+
+ VerticalAlignment="Center"
+ IsReadOnly="True"
+ Style="{StaticResource TextBoxPlusBaseStyle}"
+ Text="{Binding Motor.MotorPower}" />
-
-
-
+
+
+
+
+
+
-
+
+
-
+ hc:TitleElement.TitleWidth="120"
+ Text="{Binding AxisNo, Mode=TwoWay}" />
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ Grid.ColumnSpan="2"
+ HorizontalAlignment="Right"
+ Orientation="Horizontal">
+
+
+
-
-
-
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs
index 31dbe79..a351ad3 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs
@@ -1,27 +1,38 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using HandyControl.Controls;
+using Sinvo.EplanHpD.Plugin.WPFUI.Models;
+using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
{
///
/// CableLectotypeWindow.xaml 的交互逻辑
///
- 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();
+ _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);
}
}
}
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml
index 7db2f3c..fdfa06e 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml
@@ -382,6 +382,7 @@
BorderBrush="Gray"
BorderThickness="2,0,0,0"
ItemsSource="{Binding SubLines}"
+ PreviewMouseWheel="ListView_PreviewMouseWheel"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionChanged="SubDetailsDataGrid_SelectionChanged"
SelectionMode="Single">
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml.cs
index beaaa48..210bdc8 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml.cs
@@ -13,6 +13,8 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Forms.Integration;
+using System.Windows.Input;
namespace Sinvo.EplanHpD.Plugin.WPFUI
{
@@ -357,7 +359,21 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
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);
}
}
}