|
|
@@ -128,6 +128,7 @@ namespace BeDesignerSCADA.Controls |
|
|
|
if (menuRunCanvasModel.MenuModel.pageModels.Count > 0) |
|
|
|
{ |
|
|
|
menuRunCanvasModel.MenuModel.SelectPageModels = menuRunCanvasModel.MenuModel.pageModels[0]; |
|
|
|
menuRunCanvasModel.SelectId = menuRunCanvasModel.MenuModel.pageModels[0].Id; |
|
|
|
} |
|
|
|
|
|
|
|
SelectMenu(); |
|
|
@@ -166,6 +167,7 @@ namespace BeDesignerSCADA.Controls |
|
|
|
/// <param name="canvas"></param> |
|
|
|
public void Run(List<FrameworkElement> canvas) |
|
|
|
{ |
|
|
|
Config.GetInstance().Reset(); |
|
|
|
RootCanvas.Children.Clear(); |
|
|
|
foreach (FrameworkElement element in canvas) |
|
|
|
{ |
|
|
@@ -245,6 +247,22 @@ namespace BeDesignerSCADA.Controls |
|
|
|
|
|
|
|
public class MenuRunCanvasModel : ObservableObject |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// 选中ID |
|
|
|
/// </summary> |
|
|
|
private string _SelectId; |
|
|
|
public string SelectId |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return _SelectId; |
|
|
|
} |
|
|
|
set |
|
|
|
{ |
|
|
|
_SelectId = value; |
|
|
|
OnPropertyChanged("SelectId"); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 菜单Model |
|
|
|
/// </summary> |
|
|
@@ -279,7 +297,9 @@ namespace BeDesignerSCADA.Controls |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
Rx(SelectId); |
|
|
|
MenuModel.SelectPageModels = obj as PageModel; |
|
|
|
SelectId = MenuModel.SelectPageModels.Id; |
|
|
|
List<FrameworkElement> Children = new List<FrameworkElement>(); |
|
|
|
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) |
|
|
|
{ |
|
|
|
Config.GetInstance().Reset(); |
|
|
|
canvas1.Children.Clear(); |
|
|
|
foreach (FrameworkElement element in canvas) |
|
|
|
{ |
|
|
|