终端一体化运控平台
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.
 
 
 

65 lines
2.0 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. LoadingData(System.AppDomain.CurrentDomain.BaseDirectory + "LayoutFile\\物料仓管理.lay");
  38. }
  39. /// <summary>
  40. /// 加载数据
  41. /// </summary>
  42. public void LoadingData(string path)
  43. {
  44. //加载控件
  45. List<FrameworkElement> Children = new List<FrameworkElement>();
  46. FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
  47. using (StreamReader sr = new StreamReader(fs,System.Text.Encoding.Unicode))
  48. {
  49. while (sr.Peek() > -1)
  50. {
  51. string str = sr.ReadLine();
  52. var ele = XamlReader.Parse(str) as FrameworkElement;
  53. Children.Add(ele);
  54. }
  55. }
  56. if (Children.Count > 0)
  57. {
  58. runCanvas.Run(Children);
  59. }
  60. }
  61. }
  62. }