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("VirtualWidth"); // Height = Globals.SessionAs("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); } } }