public void ShowHide()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            RealWindow.Content = grid;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                iService.Hide();
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.IsFalse(RealWindow.IsVisible);
                iService.Show();
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.IsTrue(RealWindow.IsVisible);
            });
            EnqueueTestComplete();
        }
Ejemplo n.º 2
0
        public void SetWindowState()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            RealWindow.Content = grid;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                iService.SetWindowState(WindowState.Maximized);
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.AreEqual(WindowState.Maximized, RealWindow.WindowState);
                iService.SetWindowState(WindowState.Minimized);
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.AreEqual(WindowState.Minimized, RealWindow.WindowState);
            });
            EnqueueTestComplete();
        }
 public static void SetWindowState(this ICurrentWindowService service, WindowState state)
 {
     VerifyService(service);
     service.WindowState = DXWindowStateConverter.ToDXWindowState(state);
 }