1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using Aitex.Core.Util;
- namespace Aitex.Core.UI.View.Frame
- {
- public partial class StandardFrameWindow : Window
- {
- public string LayoutXMLFile;
- public UserControl TopView { set; private get; }
- public UserControl CenterView { set; private get; }
- public UserControl BottomView { set; private get; }
- public StandardFrameWindow()
- {
- InitializeComponent();
- //计算虚拟屏幕尺寸
- //var screenWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
- //var screenHeight = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
- //var width = 1024 * screenWidth / screenHeight;
- //if (width < 1280) width = 1280;
- //var height = 1024;
- //Globals.Session["VirtualWidth"] = width;
- //Globals.Session["VirtualHeight"] = height;
- this.Loaded += new RoutedEventHandler(StandardFrameWindow_Loaded);
- IsVisibleChanged += new DependencyPropertyChangedEventHandler(MainWindow_IsVisibleChanged);
- }
- void MainWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- //if ((bool)e.NewValue)
- //{
- // Width = Globals.SessionAs<int>("VirtualWidth");
- // Height = Globals.SessionAs<int>("VirtualHeight");
- //}
- }
- void StandardFrameWindow_Loaded(object sender, RoutedEventArgs e)
- {
- if (TopView != null)
- TopPanel.Children.Add(TopView);
- if (CenterView != null)
- CenterPanel.Children.Add(CenterView);
- if (BottomView != null)
- BottomPanel.Children.Add(BottomView);
- }
- }
- }
|