Kaynağa Gözat

1

样式分支
fyf 2 yıl önce
ebeveyn
işleme
a852f7d527
4 değiştirilmiş dosya ile 35 ekleme ve 1 silme
  1. BIN
     
  2. +2
    -1
      BeDesignerSCADA/Controls/CanvasPanelNew.xaml.cs
  3. +1
    -0
      BeDesignerSCADA/Controls/MenuRunCanvas.xaml
  4. +32
    -0
      BeDesignerSCADA/Controls/MenuRunCanvas.xaml.cs

+ 2
- 1
BeDesignerSCADA/Controls/CanvasPanelNew.xaml.cs Dosyayı Görüntüle

@@ -1,5 +1,6 @@
using BeDesignerSCADA.Common;
using BeDesignerSCADA.View;
using Newtonsoft.Json;
using BeDesignerSCADA.ViewModel;
using BPASmart.Model;
using BPASmartClient.Compiler;
@@ -269,7 +270,7 @@ namespace BeDesignerSCADA.Controls
runWindows = null;
}
runWindows = new RunWindows();
runWindows.LoadingData(viewModel.MenuModel);
runWindows.LoadingData(JsonConvert.DeserializeObject<MenuModel>(JsonConvert.SerializeObject(viewModel.MenuModel)));
runWindows.Show();
}
/// <summary>


+ 1
- 0
BeDesignerSCADA/Controls/MenuRunCanvas.xaml Dosyayı Görüntüle

@@ -20,6 +20,7 @@

<Grid>
<Canvas
Tag="{Binding SelectId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
x:Name="RootCanvas"
Background="Transparent"
ClipToBounds="True"


+ 32
- 0
BeDesignerSCADA/Controls/MenuRunCanvas.xaml.cs Dosyayı Görüntüle

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


Yükleniyor…
İptal
Kaydet