StandardFrameWindow.xaml.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using Aitex.Core.Util;
  15. namespace Aitex.Core.UI.View.Frame
  16. {
  17. public partial class StandardFrameWindow : Window
  18. {
  19. public string LayoutXMLFile;
  20. public UserControl TopView { set; private get; }
  21. public UserControl CenterView { set; private get; }
  22. public UserControl BottomView { set; private get; }
  23. public StandardFrameWindow()
  24. {
  25. InitializeComponent();
  26. //计算虚拟屏幕尺寸
  27. //var screenWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
  28. //var screenHeight = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
  29. //var width = 1024 * screenWidth / screenHeight;
  30. //if (width < 1280) width = 1280;
  31. //var height = 1024;
  32. //Globals.Session["VirtualWidth"] = width;
  33. //Globals.Session["VirtualHeight"] = height;
  34. this.Loaded += new RoutedEventHandler(StandardFrameWindow_Loaded);
  35. IsVisibleChanged += new DependencyPropertyChangedEventHandler(MainWindow_IsVisibleChanged);
  36. }
  37. void MainWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  38. {
  39. //if ((bool)e.NewValue)
  40. //{
  41. // Width = Globals.SessionAs<int>("VirtualWidth");
  42. // Height = Globals.SessionAs<int>("VirtualHeight");
  43. //}
  44. }
  45. void StandardFrameWindow_Loaded(object sender, RoutedEventArgs e)
  46. {
  47. if (TopView != null)
  48. TopPanel.Children.Add(TopView);
  49. if (CenterView != null)
  50. CenterPanel.Children.Add(CenterView);
  51. if (BottomView != null)
  52. BottomPanel.Children.Add(BottomView);
  53. }
  54. }
  55. }