diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Common/LectotypeMessage.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Common/LectotypeMessage.cs new file mode 100644 index 0000000..1581d4d --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Common/LectotypeMessage.cs @@ -0,0 +1,16 @@ +using CommunityToolkit.Mvvm.Messaging.Messages; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sinvo.EplanHpD.Plugin.WPFUI.Common +{ + internal class LectotypeMessage : ValueChangedMessage> + { + public LectotypeMessage(Dictionary value) : base(value) + { + } + } +} diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj index 4d7d49f..fabeda5 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj @@ -152,6 +152,7 @@ + @@ -164,6 +165,7 @@ + @@ -198,6 +200,10 @@ CableLectotypeUserControl.xaml + + + NotSavedWarningWindow.xaml + LayoutHelperWindow.xaml @@ -225,6 +231,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeUserControl.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeUserControl.xaml index 5b4a2f0..e7c1582 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeUserControl.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeUserControl.xaml @@ -321,17 +321,17 @@ - + (new LectotypeMessage + (new System.Collections.Generic.Dictionary + { + {motor.Motor.MotorModelStr,motor.Motor.AxisNo} + })); + } } private void ListView_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningViewModel.cs new file mode 100644 index 0000000..e33719f --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningViewModel.cs @@ -0,0 +1,44 @@ +using CommunityToolkit.Mvvm.Input; +using HandyControl.Tools.Extension; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace Sinvo.EplanHpD.Plugin.WPFUI.View.Dialog +{ + public class NotSavedWarningViewModel : INotifyPropertyChanged, IDialogResultable + { + + public event PropertyChangedEventHandler PropertyChanged; + + public void OnChange([CallerMemberName] string propName = null) + { + PropertyChanged?.Invoke(propName, new PropertyChangedEventArgs(propName)); + } + + private Dictionary _notSavedLectotypeList = []; + public Dictionary NotSavedLectotypeList + { + get => _notSavedLectotypeList; + set + { + _notSavedLectotypeList = value; + OnChange(); + } + } + + public bool Result { get ; set ; } + public Action CloseAction { get; set; } + + + internal void Close(bool result) + { + Result = result; + CloseAction?.Invoke(); + } + } +} diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningWindow.xaml new file mode 100644 index 0000000..34f3ec1 --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningWindow.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + +