Browse Source

1

样式分支
fyf 2 years ago
parent
commit
d1451a579c
4 changed files with 16 additions and 14 deletions
  1. +2
    -2
      BPASmart.ConfigurationSoftware/MainWindowViewModel.cs
  2. +1
    -1
      BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs
  3. +3
    -1
      BeDesignerSCADA/Adorners/SelectionAdorner.cs
  4. +10
    -10
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs

+ 2
- 2
BPASmart.ConfigurationSoftware/MainWindowViewModel.cs View File

@@ -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);
}
});



+ 1
- 1
BPASmartClient.SCADAControl/CustomerControls/StatusLight.cs View File

@@ -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));


+ 3
- 1
BeDesignerSCADA/Adorners/SelectionAdorner.cs View File

@@ -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<CanvasPanel>(AdornedElement);



+ 10
- 10
BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs View File

@@ -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 位置调整
/// <summary>


Loading…
Cancel
Save