From d1451a579c1cbfea23c79813ea445baf49cb332f Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 20 Sep 2022 10:05:44 +0800 Subject: [PATCH 1/4] 1 --- .../MainWindowViewModel.cs | 4 ++-- .../CustomerControls/StatusLight.cs | 2 +- BeDesignerSCADA/Adorners/SelectionAdorner.cs | 4 +++- .../Controls/MainCanvasPanel.xaml.cs | 20 +++++++++---------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs b/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs index ac95b7d1..328a618d 100644 --- a/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs +++ b/BPASmart.ConfigurationSoftware/MainWindowViewModel.cs @@ -77,8 +77,8 @@ namespace BPASmart.ConfigurationSoftware var res = mainCanvasPanels.FirstOrDefault(p => p.PageName == o.ToString()); if (res != null) { - ConstructorInfo cti = res.MainCanvasPanelModel.GetType()?.GetConstructor(System.Type.EmptyTypes); - MainContent = (FrameworkElement)cti?.Invoke(null); + //ConstructorInfo cti = res.MainCanvasPanelModel.GetType()?.GetConstructor(System.Type.EmptyTypes); + MainContent = res.MainCanvasPanelModel;// (FrameworkElement)cti?.Invoke(null); } }); diff --git a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs index 05637421..8f72bbe8 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs @@ -72,7 +72,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls switch (StatusValue) { case 0: - image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State0.png", UriKind.Absolute)); + image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State0.png", UriKind.Absolute)); break; case -1: image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State11.png", UriKind.Absolute)); diff --git a/BeDesignerSCADA/Adorners/SelectionAdorner.cs b/BeDesignerSCADA/Adorners/SelectionAdorner.cs index 61139545..2dfbaa35 100644 --- a/BeDesignerSCADA/Adorners/SelectionAdorner.cs +++ b/BeDesignerSCADA/Adorners/SelectionAdorner.cs @@ -28,7 +28,9 @@ namespace BeDesignerSCADA.Adorners MouseDown += SelectionAdorner_MouseDown; MouseMove += SelectionAdorner_MouseMove; MouseUp += SelectionAdorner_MouseUp; - + ResourceDictionary languageResDic = new ResourceDictionary(); + languageResDic.Source = new Uri(@"/BeDesignerSCADA;component/Themes/Styles.xaml", UriKind.RelativeOrAbsolute); + this.Resources.MergedDictionaries.Add(languageResDic); ContextMenu = FindResource("AdornerRightMenu") as ContextMenu; Tag = CanvasPanel.GetParentObject(AdornedElement); diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs index 8d4337a3..45b8b840 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs @@ -49,16 +49,16 @@ namespace BeDesignerSCADA.Controls //读取文件 FileRead(_Path); } - public MainCanvasPanel() - { - InitializeComponent(); - this.DataContext = viewModel; - viewModel.Loaded(cav, runCanvas); - //控件加载 - Assembly assembly = Assembly.LoadFile($"{System.AppDomain.CurrentDomain.BaseDirectory}\\BPASmartClient.SCADAControl.dll"); //Assembly.GetExecutingAssembly(); - var controls = assembly.GetTypes().Where(t => t.GetInterface("IExecutable") != null).OrderBy(o => o.Name); - CtlList.ItemsSource = controls; - } + //public MainCanvasPanel() + //{ + // InitializeComponent(); + // this.DataContext = viewModel; + // viewModel.Loaded(cav, runCanvas); + // //控件加载 + // Assembly assembly = Assembly.LoadFile($"{System.AppDomain.CurrentDomain.BaseDirectory}\\BPASmartClient.SCADAControl.dll"); //Assembly.GetExecutingAssembly(); + // var controls = assembly.GetTypes().Where(t => t.GetInterface("IExecutable") != null).OrderBy(o => o.Name); + // CtlList.ItemsSource = controls; + //} #region 位置调整 /// From ba09f10d163dc9e636ebb33af0df8e8d36c99096 Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 20 Sep 2022 10:22:19 +0800 Subject: [PATCH 2/4] 111 --- .../BPASmartClient.SCADAControl.csproj | 4 ++-- .../CustomerControls/GraphArrow.xaml.cs | 2 +- .../CustomerControls/GraphStar.xaml.cs | 2 +- .../CustomerControls/NewConveyorBelt.xaml.cs | 2 +- .../CustomerControls/NumberBox.cs | 2 +- .../CustomerControls/Silos.xaml.cs | 2 +- .../CustomerControls/StatusLight.cs | 2 +- .../CustomerControls/TheAPI.xaml.cs | 2 +- .../CustomerControls/TheBlueProgressBar.cs | 2 +- .../CustomerControls/TheComboBox.xaml.cs | 2 +- .../CustomerControls/TheDataGrid.xaml.cs | 2 +- .../CustomerControls/TheGreenProgressBar.cs | 2 +- .../CustomerControls/TheListBox.xaml.cs | 2 +- .../CustomerControls/TheMQTT.xaml.cs | 2 +- .../CustomerControls/TheProgressBar.cs | 2 +- .../CustomerControls/TheRadioButton.cs | 4 ++-- .../CustomerControls/TheRedProgressBar.cs | 2 +- .../CustomerControls/TheRedis.xaml.cs | 2 +- .../CustomerControls/TheSlider.cs | 2 +- .../CustomerControls/TheTextBox.cs | 2 +- .../CustomerControls/TheTimer.cs | 5 ++++- .../Images/{btnnormal.png => btnkeys.png} | Bin BPASmartClient.SCADAControl/Themes/Generic.xaml | 6 +++--- 23 files changed, 29 insertions(+), 26 deletions(-) rename BPASmartClient.SCADAControl/Images/{btnnormal.png => btnkeys.png} (100%) diff --git a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj index 94929bcf..e966f8b0 100644 --- a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj +++ b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj @@ -13,7 +13,7 @@ - + @@ -70,7 +70,7 @@ Always - + Always diff --git a/BPASmartClient.SCADAControl/CustomerControls/GraphArrow.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/GraphArrow.xaml.cs index 7de4de7a..6cbb7cbd 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/GraphArrow.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/GraphArrow.xaml.cs @@ -45,7 +45,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls { IsEnabled = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/GraphStar.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/GraphStar.xaml.cs index 67c377e1..77ed8a92 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/GraphStar.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/GraphStar.xaml.cs @@ -45,7 +45,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls { IsEnabled = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/NewConveyorBelt.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/NewConveyorBelt.xaml.cs index 3901eca6..1def1f8d 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/NewConveyorBelt.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/NewConveyorBelt.xaml.cs @@ -105,7 +105,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls { IsEnabled = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/NumberBox.cs b/BPASmartClient.SCADAControl/CustomerControls/NumberBox.cs index 784e0df8..669a3e1a 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/NumberBox.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/NumberBox.cs @@ -71,7 +71,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls { IsEnabled = true; Register(); - Style = null; + //Style = null; Focusable = true; } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/Silos.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/Silos.xaml.cs index f8d7ff61..6f60daeb 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/Silos.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/Silos.xaml.cs @@ -111,7 +111,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls { IsEnabled = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs index 8f72bbe8..bbec8abf 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs @@ -72,7 +72,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls switch (StatusValue) { case 0: - image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State0.png", UriKind.Absolute)); + image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State0.png", UriKind.Relative)); break; case -1: image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State11.png", UriKind.Absolute)); diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheAPI.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheAPI.xaml.cs index fcb06898..4a1b290b 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheAPI.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheAPI.xaml.cs @@ -86,7 +86,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheBlueProgressBar.cs b/BPASmartClient.SCADAControl/CustomerControls/TheBlueProgressBar.cs index 515afa53..35f765cc 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheBlueProgressBar.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheBlueProgressBar.cs @@ -46,7 +46,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheComboBox.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheComboBox.xaml.cs index 2eed2a35..d84de1f7 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheComboBox.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheComboBox.xaml.cs @@ -61,7 +61,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls Focusable = true; IsEnabled = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs index 4826d36a..c37d9618 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs @@ -59,7 +59,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls isExecuteState = value; if (IsExecuteState) { - Style = null; + //Style = null; Register(); } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheGreenProgressBar.cs b/BPASmartClient.SCADAControl/CustomerControls/TheGreenProgressBar.cs index 8cff9a97..53373045 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheGreenProgressBar.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheGreenProgressBar.cs @@ -47,7 +47,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs index 2a5b4d46..0742a067 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs @@ -73,7 +73,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls isExecuteState = value; if (IsExecuteState) { - Style = null; + //Style = null; Register(); } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheMQTT.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheMQTT.xaml.cs index 58481edd..8e72f96b 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheMQTT.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheMQTT.xaml.cs @@ -108,7 +108,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheProgressBar.cs b/BPASmartClient.SCADAControl/CustomerControls/TheProgressBar.cs index 03c47edf..25a3dab2 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheProgressBar.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheProgressBar.cs @@ -50,7 +50,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheRadioButton.cs b/BPASmartClient.SCADAControl/CustomerControls/TheRadioButton.cs index cecfc87e..9fb6131b 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheRadioButton.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheRadioButton.cs @@ -26,7 +26,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls ResourceDictionary languageResDic = new ResourceDictionary(); languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute); this.Resources.MergedDictionaries.Add(languageResDic); - //SetCurrentValue(ContentProperty, "单选按钮"); + SetCurrentValue(ContentProperty, "单选按钮"); } static TheRadioButton() { @@ -45,7 +45,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheRedProgressBar.cs b/BPASmartClient.SCADAControl/CustomerControls/TheRedProgressBar.cs index fc62e200..02708277 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheRedProgressBar.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheRedProgressBar.cs @@ -47,7 +47,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheRedis.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheRedis.xaml.cs index da06aa11..566b2d08 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheRedis.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheRedis.xaml.cs @@ -108,7 +108,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheSlider.cs b/BPASmartClient.SCADAControl/CustomerControls/TheSlider.cs index 37f8dfa0..0651e6d1 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheSlider.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheSlider.cs @@ -38,7 +38,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs b/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs index e5032dae..b32269a4 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs @@ -93,7 +93,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls IsEnabled = true; Focusable = true; Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheTimer.cs b/BPASmartClient.SCADAControl/CustomerControls/TheTimer.cs index 491e14fc..c5bc0d40 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheTimer.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheTimer.cs @@ -27,6 +27,9 @@ namespace BPASmartClient.SCADAControl.CustomerControls { Width = 40; Height = 40; + ResourceDictionary languageResDic = new ResourceDictionary(); + languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml", UriKind.RelativeOrAbsolute); + this.Resources.MergedDictionaries.Add(languageResDic); } static TheTimer() { @@ -46,7 +49,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls if (IsExecuteState) { Register(); - Style = null; + //Style = null; } } } diff --git a/BPASmartClient.SCADAControl/Images/btnnormal.png b/BPASmartClient.SCADAControl/Images/btnkeys.png similarity index 100% rename from BPASmartClient.SCADAControl/Images/btnnormal.png rename to BPASmartClient.SCADAControl/Images/btnkeys.png diff --git a/BPASmartClient.SCADAControl/Themes/Generic.xaml b/BPASmartClient.SCADAControl/Themes/Generic.xaml index 2f83edcf..11f1fcb0 100644 --- a/BPASmartClient.SCADAControl/Themes/Generic.xaml +++ b/BPASmartClient.SCADAControl/Themes/Generic.xaml @@ -1429,11 +1429,11 @@ - + From 7058c848a939c14504d54cbf203f02cf489d3f5c Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 20 Sep 2022 10:25:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=BA=20=E5=B7=A5=E7=A8=8B=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs | 6 +++--- BPASmartClient.SCADAControl/Themes/Generic.xaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs index bbec8abf..f1a21b7d 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs @@ -75,13 +75,13 @@ namespace BPASmartClient.SCADAControl.CustomerControls image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State0.png", UriKind.Relative)); break; case -1: - image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State11.png", UriKind.Absolute)); + image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State11.png", UriKind.Relative)); break; case 1: - image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State1.png", UriKind.Absolute)); + image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State1.png", UriKind.Relative)); break; case 2: - image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State2.png", UriKind.Absolute)); + image.Source = new BitmapImage(new Uri(@"/BPASmartClient.SCADAControl;component/Images/State2.png", UriKind.Relative)); break; default: break; diff --git a/BPASmartClient.SCADAControl/Themes/Generic.xaml b/BPASmartClient.SCADAControl/Themes/Generic.xaml index 11f1fcb0..4c28efcb 100644 --- a/BPASmartClient.SCADAControl/Themes/Generic.xaml +++ b/BPASmartClient.SCADAControl/Themes/Generic.xaml @@ -1429,11 +1429,11 @@ - + From 24d2cff7de3d01e0ebe43acd2121ee0c8bfd577b Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 20 Sep 2022 10:33:55 +0800 Subject: [PATCH 4/4] 1 --- BPASmart.ConfigurationSoftware/MainWindow.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/BPASmart.ConfigurationSoftware/MainWindow.xaml b/BPASmart.ConfigurationSoftware/MainWindow.xaml index ba4e971b..d9856005 100644 --- a/BPASmart.ConfigurationSoftware/MainWindow.xaml +++ b/BPASmart.ConfigurationSoftware/MainWindow.xaml @@ -6,6 +6,7 @@ xmlns:local="clr-namespace:BPASmart.ConfigurationSoftware" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="MainWindow" + WindowState="Maximized" Width="800" Height="450" Topmost="False"