Exemplo n.º 1
0
 public void setWindowConfiguration(WindowConfiguration wc)
 {
     if (wc != null)
     {
         Width = wc.Width;
         Height = wc.Height;
         Left = wc.Position.X;
         Top = wc.Position.Y;
     }
     else
     {
         WindowStartupLocation = WindowStartupLocation.CenterScreen;
     }
 }
Exemplo n.º 2
0
        protected void Window_Closing(object sender, CancelEventArgs e)
        {
            WindowConfiguration ws = getWindowConfiguration(MainWindow.UserConfiguration, App._currentUser, sender.ToString());
            if (ws == null)
            {
                ws = new WindowConfiguration();
                MainWindow.UserConfiguration.GetApplicationconfigurationFromUsername(App._currentUser).WindowsConfiguration.Add(sender.ToString(), ws);
            }

            ws.Width = ActualWidth;
            ws.Height = ActualHeight;
            ws.Position = new Point(Left, Top);

            StorageUtil.Save(MainWindow.UserConfiguration, AppResources.CONFIGURATION_FILENAME);
        }