예제 #1
0
        public MainForm(bool isVisible)
        {
            InitializeComponent();

            this.Width       = Properties.Settings.Default.MainFormExBounds.Width;
            this.Height      = Properties.Settings.Default.MainFormExBounds.Height;
            this.Top         = Properties.Settings.Default.MainFormExBounds.Y;
            this.Left        = Properties.Settings.Default.MainFormExBounds.X;
            this.WindowState = Properties.Settings.Default.WindowState;

            this.Loaded += delegate
            {
                if (!UiUtils.IsOnScreen(this))
                {
                    UiUtils.CenterWindow(this);
                }
            };
            this.isVisible = isVisible;

            inputData        = new MainViewModel();
            this.DataContext = inputData;

            this.PreviewKeyDown += MainFormEx_PreviewKeyDown;
            this.PreviewKeyUp   += MainFormEx_PreviewKeyUp;
        }
예제 #2
0
        void PreviewView_Loaded(object sender, RoutedEventArgs e)
        {
            this.Left   = Properties.Settings.Default.PreviewBounds.Left;
            this.Top    = Properties.Settings.Default.PreviewBounds.Top;
            this.Width  = Properties.Settings.Default.PreviewBounds.Width;
            this.Height = Properties.Settings.Default.PreviewBounds.Height;

            if (!UiUtils.IsOnScreen(this))
            {
                UiUtils.CenterWindow(this);
            }
        }
예제 #3
0
 void window_Loaded(object sender, RoutedEventArgs e)
 {
     StickyWindow = new StickyWindow(this);
     StickyWindow.StickToScreen     = true;
     StickyWindow.StickToOther      = true;
     StickyWindow.StickOnResize     = true;
     StickyWindow.StickOnMove       = true;
     StickyWindow.MoveStuckTogether = false;
     if (!UiUtils.IsOnScreen(this))
     {
         UiUtils.CenterWindow(this);
     }
 }
예제 #4
0
 public MainFormEx(bool isVisible)
 {
     InitializeComponent();
     this.Width  = Properties.Settings.Default.Width;
     this.Height = Properties.Settings.Default.Height;
     this.Top    = Properties.Settings.Default.Top;
     this.Left   = Properties.Settings.Default.Left;
     if (!UiUtils.IsOnScreen(this))
     {
         UiUtils.CenterWindow(this);
     }
     this.isVisible   = isVisible;
     inputData        = new MainViewModel();
     this.DataContext = inputData;
 }