|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using BPASmartClient.Compiler;
- using BPASmartClient.MessageCommunication;
- using BPASmartClient.MessageCommunication.MsgControl;
- using BPASmartClient.MessageName;
- using BPASmartClient.MessageName.EnumHelp;
- using BPASmartClient.MessageName.发送消息Model;
- using BPASmartClient.MessageName.接收消息Model;
- using BPASmartClient.MessageName.接收消息Model.物料仓;
- using Microsoft.Win32;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Markup;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
-
- namespace BPASmartClient.MinimalistUI
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow :Window
- {
- public MainWindow()
- {
- InitializeComponent();
- Directory.CreateDirectory(System.IO. Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"LayoutFile"));
- LoadingData(System.AppDomain.CurrentDomain.BaseDirectory + "LayoutFile\\物料仓管理.lay");
- }
- /// <summary>
- /// 加载数据
- /// </summary>
- public void LoadingData(string path)
- {
- //加载控件
- List<FrameworkElement> Children = new List<FrameworkElement>();
- FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
- using (StreamReader sr = new StreamReader(fs,System.Text.Encoding.Unicode))
- {
- while (sr.Peek() > -1)
- {
- string str = sr.ReadLine();
- var ele = XamlReader.Parse(str) as FrameworkElement;
- Children.Add(ele);
- }
- }
- if (Children.Count > 0)
- {
- runCanvas.Run(Children);
- }
-
- }
- }
- }
|