终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 regels
2.1 KiB

  1. using BPASmartClient.Compiler;
  2. using BPASmartClient.MessageCommunication;
  3. using BPASmartClient.MessageCommunication.MsgControl;
  4. using BPASmartClient.MessageName;
  5. using BPASmartClient.MessageName.EnumHelp;
  6. using BPASmartClient.MessageName.发送消息Model;
  7. using BPASmartClient.MessageName.接收消息Model;
  8. using BPASmartClient.MessageName.接收消息Model.物料仓;
  9. using Microsoft.Win32;
  10. using Newtonsoft.Json;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Windows;
  18. using System.Windows.Controls;
  19. using System.Windows.Data;
  20. using System.Windows.Documents;
  21. using System.Windows.Input;
  22. using System.Windows.Markup;
  23. using System.Windows.Media;
  24. using System.Windows.Media.Imaging;
  25. using System.Windows.Navigation;
  26. using System.Windows.Shapes;
  27. namespace BPASmartClient.MinimalistUI
  28. {
  29. /// <summary>
  30. /// Interaction logic for MainWindow.xaml
  31. /// </summary>
  32. public partial class MainWindow :Window
  33. {
  34. public MainWindow()
  35. {
  36. InitializeComponent();
  37. Directory.CreateDirectory(System.IO. Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"LayoutFile"));
  38. LoadingData(System.AppDomain.CurrentDomain.BaseDirectory + "LayoutFile\\物料仓管理.lay");
  39. }
  40. /// <summary>
  41. /// 加载数据
  42. /// </summary>
  43. public void LoadingData(string path)
  44. {
  45. //加载控件
  46. List<FrameworkElement> Children = new List<FrameworkElement>();
  47. FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
  48. using (StreamReader sr = new StreamReader(fs,System.Text.Encoding.Unicode))
  49. {
  50. while (sr.Peek() > -1)
  51. {
  52. string str = sr.ReadLine();
  53. var ele = XamlReader.Parse(str) as FrameworkElement;
  54. Children.Add(ele);
  55. }
  56. }
  57. if (Children.Count > 0)
  58. {
  59. runCanvas.Run(Children);
  60. }
  61. }
  62. }
  63. }