Exemplo n.º 1
0
        public void Show(TransientProfileStatusesViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            var view = new ProfileStatusesView();

            view.DataContext = viewModel;
            var profileStatusesWindow = new GenericElementHostWindow();

            profileStatusesWindow.Text         = "Synchronization Status";
            profileStatusesWindow.Icon         = Resources.ApplicationIcon;
            profileStatusesWindow.ShowIcon     = true;
            profileStatusesWindow.BackColor    = SystemColors.Window;
            profileStatusesWindow.Child        = view;
            profileStatusesWindow.Size         = new Size(400, 300);
            profileStatusesWindow.FormClosing += (sender, e) =>
            {
                viewModel.OnViewClosing();
            };
            viewModel.RequestingBringToFront += (sender, e) =>
            {
                profileStatusesWindow.BringToFront();
            };
            profileStatusesWindow.Show();
        }
Exemplo n.º 2
0
        private static void SetWindowSize(GenericElementHostWindow window, double ratioToCurrentScreensize)
        {
            var screenSize = Screen.FromControl(window).Bounds;

            window.Size = new Size(
                (int)(screenSize.Size.Width * ratioToCurrentScreensize),
                (int)(screenSize.Size.Height * ratioToCurrentScreensize));
        }
Exemplo n.º 3
0
    public void Show (ReportsViewModel reportsViewModel)
    {
      var view = new ReportsView();
      view.DataContext = reportsViewModel;

      var window = new GenericElementHostWindow();

      window.Text = "Synchronization Reports";
      window.Child = view;
      window.Show();
      window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); };

      reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); };

      SetWindowSizeToQuarterOfScreenSize (window);
    }
        public void Show(ReportsViewModel reportsViewModel)
        {
            var view = new ReportsView();

            view.DataContext = reportsViewModel;

            var window = new GenericElementHostWindow();

            window.Text  = "Synchronization Reports";
            window.Child = view;
            window.Show();
            window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); };

            reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); };

            SetWindowSizeToQuarterOfScreenSize(window);
        }
    public void Show (ReportsViewModel reportsViewModel)
    {
      var view = new ReportsView();
      view.DataContext = reportsViewModel;

      var window = new GenericElementHostWindow();

      window.Text = "Synchronization Reports";
      window.Icon = Resources.ApplicationIcon;
      window.ShowIcon = true;
      window.BackColor = SystemColors.Window;
      window.Child = view;
      window.Show();
      window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); };

      reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); };

      SetWindowSize (window, 0.75);
    }
Exemplo n.º 6
0
        public void Show(ReportsViewModel reportsViewModel)
        {
            var view = new ReportsView();

            view.DataContext = reportsViewModel;

            var window = new GenericElementHostWindow();

            window.Text      = "Synchronization Reports";
            window.Icon      = Resources.ApplicationIcon;
            window.ShowIcon  = true;
            window.BackColor = SystemColors.Window;
            window.Child     = view;
            window.Show();
            window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); };

            reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); };

            SetWindowSize(window, 0.75);
        }
   public UiService (ProfileStatusesViewModel viewModel)
   {
     if (viewModel == null)
       throw new ArgumentNullException (nameof (viewModel));
 
     var view = new ProfileStatusesView();
     view.DataContext = viewModel;
     _profileStatusesWindow = new GenericElementHostWindow();
     _profileStatusesWindow.Text = "Synchronization Status";
     _profileStatusesWindow.Icon = Resources.ApplicationIcon;
     _profileStatusesWindow.ShowIcon = true;
     _profileStatusesWindow.BackColor = SystemColors.Window;
     _profileStatusesWindow.Child = view;
     _profileStatusesWindow.Size = new Size (400, 300);
     _profileStatusesWindow.FormClosing += (sender, e) =>
     {
       e.Cancel = true;
       _profileStatusesWindow.Visible = false;
     };
   }
Exemplo n.º 8
0
        public UiService(ProfileStatusesViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            var view = new ProfileStatusesView();

            view.DataContext                    = viewModel;
            _profileStatusesWindow              = new GenericElementHostWindow();
            _profileStatusesWindow.Text         = "Synchronization Status";
            _profileStatusesWindow.Icon         = Resources.ApplicationIcon;
            _profileStatusesWindow.ShowIcon     = true;
            _profileStatusesWindow.BackColor    = SystemColors.Window;
            _profileStatusesWindow.Child        = view;
            _profileStatusesWindow.Size         = new Size(400, 300);
            _profileStatusesWindow.FormClosing += (sender, e) =>
            {
                e.Cancel = true;
                _profileStatusesWindow.Visible = false;
            };
        }
        private static void SetWindowSizeToQuarterOfScreenSize(GenericElementHostWindow window)
        {
            var screenSize = Screen.FromControl(window).Bounds;

            window.Size = new System.Drawing.Size(screenSize.Size.Width / 2, screenSize.Size.Height / 2);
        }
Exemplo n.º 10
0
 private static void SetWindowSizeToQuarterOfScreenSize (GenericElementHostWindow window)
 {
   var screenSize = Screen.FromControl (window).Bounds;
   window.Size = new System.Drawing.Size (screenSize.Size.Width / 2, screenSize.Size.Height / 2);
 }
Exemplo n.º 11
0
 private static void SetWindowSize (GenericElementHostWindow window, double ratioToCurrentScreensize)
 {
   var screenSize = Screen.FromControl (window).Bounds;
   window.Size = new Size (
       (int) (screenSize.Size.Width * ratioToCurrentScreensize),
       (int) (screenSize.Size.Height * ratioToCurrentScreensize));
 }