@@ -77,8 +77,8 @@ namespace BPASmart.ConfigurationSoftware | |||||
var res = mainCanvasPanels.FirstOrDefault(p => p.PageName == o.ToString()); | var res = mainCanvasPanels.FirstOrDefault(p => p.PageName == o.ToString()); | ||||
if (res != null) | 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); | |||||
} | } | ||||
}); | }); | ||||
@@ -72,7 +72,7 @@ namespace BPASmartClient.SCADAControl.CustomerControls | |||||
switch (StatusValue) | switch (StatusValue) | ||||
{ | { | ||||
case 0: | 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; | break; | ||||
case -1: | case -1: | ||||
image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State11.png", UriKind.Absolute)); | image.Source = new BitmapImage(new Uri("pack://application:,,,/Images/State11.png", UriKind.Absolute)); | ||||
@@ -28,7 +28,9 @@ namespace BeDesignerSCADA.Adorners | |||||
MouseDown += SelectionAdorner_MouseDown; | MouseDown += SelectionAdorner_MouseDown; | ||||
MouseMove += SelectionAdorner_MouseMove; | MouseMove += SelectionAdorner_MouseMove; | ||||
MouseUp += SelectionAdorner_MouseUp; | 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; | ContextMenu = FindResource("AdornerRightMenu") as ContextMenu; | ||||
Tag = CanvasPanel.GetParentObject<CanvasPanel>(AdornedElement); | Tag = CanvasPanel.GetParentObject<CanvasPanel>(AdornedElement); | ||||
@@ -49,16 +49,16 @@ namespace BeDesignerSCADA.Controls | |||||
//读取文件 | //读取文件 | ||||
FileRead(_Path); | 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 位置调整 | #region 位置调整 | ||||
/// <summary> | /// <summary> | ||||