|
@@ -128,6 +128,7 @@ namespace BeDesignerSCADA.Controls |
|
|
if (menuRunCanvasModel.MenuModel.pageModels.Count > 0) |
|
|
if (menuRunCanvasModel.MenuModel.pageModels.Count > 0) |
|
|
{ |
|
|
{ |
|
|
menuRunCanvasModel.MenuModel.SelectPageModels = menuRunCanvasModel.MenuModel.pageModels[0]; |
|
|
menuRunCanvasModel.MenuModel.SelectPageModels = menuRunCanvasModel.MenuModel.pageModels[0]; |
|
|
|
|
|
menuRunCanvasModel.SelectId = menuRunCanvasModel.MenuModel.pageModels[0].Id; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SelectMenu(); |
|
|
SelectMenu(); |
|
@@ -166,6 +167,7 @@ namespace BeDesignerSCADA.Controls |
|
|
/// <param name="canvas"></param> |
|
|
/// <param name="canvas"></param> |
|
|
public void Run(List<FrameworkElement> canvas) |
|
|
public void Run(List<FrameworkElement> canvas) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Config.GetInstance().Reset(); |
|
|
RootCanvas.Children.Clear(); |
|
|
RootCanvas.Children.Clear(); |
|
|
foreach (FrameworkElement element in canvas) |
|
|
foreach (FrameworkElement element in canvas) |
|
|
{ |
|
|
{ |
|
@@ -245,6 +247,22 @@ namespace BeDesignerSCADA.Controls |
|
|
|
|
|
|
|
|
public class MenuRunCanvasModel : ObservableObject |
|
|
public class MenuRunCanvasModel : ObservableObject |
|
|
{ |
|
|
{ |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 选中ID |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
private string _SelectId; |
|
|
|
|
|
public string SelectId |
|
|
|
|
|
{ |
|
|
|
|
|
get |
|
|
|
|
|
{ |
|
|
|
|
|
return _SelectId; |
|
|
|
|
|
} |
|
|
|
|
|
set |
|
|
|
|
|
{ |
|
|
|
|
|
_SelectId = value; |
|
|
|
|
|
OnPropertyChanged("SelectId"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 菜单Model |
|
|
/// 菜单Model |
|
|
/// </summary> |
|
|
/// </summary> |
|
@@ -279,7 +297,9 @@ namespace BeDesignerSCADA.Controls |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
|
|
|
Rx(SelectId); |
|
|
MenuModel.SelectPageModels = obj as PageModel; |
|
|
MenuModel.SelectPageModels = obj as PageModel; |
|
|
|
|
|
SelectId = MenuModel.SelectPageModels.Id; |
|
|
List<FrameworkElement> Children = new List<FrameworkElement>(); |
|
|
List<FrameworkElement> Children = new List<FrameworkElement>(); |
|
|
if (MenuModel.SelectPageModels != null) |
|
|
if (MenuModel.SelectPageModels != null) |
|
|
{ |
|
|
{ |
|
@@ -298,8 +318,20 @@ namespace BeDesignerSCADA.Controls |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void Rx(string id) |
|
|
|
|
|
{ |
|
|
|
|
|
//(MenuModel?.pageModels?.ToList().Find(par => par.Id == id).visual as CanvasPanel).Children.Clear(); |
|
|
|
|
|
//foreach (FrameworkElement element in canvas1.Children) |
|
|
|
|
|
//{ |
|
|
|
|
|
// string xamlText = XamlWriter.Save(element); |
|
|
|
|
|
// FrameworkElement item = XamlReader.Parse(xamlText) as FrameworkElement; |
|
|
|
|
|
// (MenuModel?.pageModels?.ToList().Find(par => par.Id == id).visual as CanvasPanel).Children.Add(item); |
|
|
|
|
|
//} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public void Run(List<FrameworkElement> canvas) |
|
|
public void Run(List<FrameworkElement> canvas) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Config.GetInstance().Reset(); |
|
|
canvas1.Children.Clear(); |
|
|
canvas1.Children.Clear(); |
|
|
foreach (FrameworkElement element in canvas) |
|
|
foreach (FrameworkElement element in canvas) |
|
|
{ |
|
|
{ |
|
|