예제 #1
0
            public void ReactivatedViewGroupIsVisible()
            {
                _uiTestHelper.ExecuteOnUIThread(() =>
                {
                    // Prepare
                    var view1 = new ViewHostControl {
                        View = new UserControl()
                    };
                    var view2 = new ViewHostControl {
                        View = new UserControl()
                    };
                    var viewGroup1 = new ViewGroup();
                    var viewGroup2 = new ViewGroup();
                    viewGroup1.Push(new View("view1")
                    {
                        ViewHostInstance = view1
                    });
                    viewGroup2.Push(new View("view2")
                    {
                        ViewHostInstance = view2
                    });
                    _workspaceAdapter.PerformUIActivation(null, viewGroup1.Peek()).Wait();
                    _workspaceAdapter.PerformUIActivation(viewGroup1.Peek(), viewGroup2.Peek()).Wait();

                    // Act
                    _workspaceAdapter.PerformUIActivation(viewGroup2.Peek(), viewGroup1.Peek()).Wait();

                    // Verify
                    Assert.IsTrue(_workspace.Children[0].Visibility == Visibility.Visible);
                    // first child corresponds to viewGroup1
                });
            }
예제 #2
0
            public void CanActivateViewMoreThanOnce()
            {
                _uiTestHelper.ExecuteOnUIThread(() =>
                {
                    // Prepare
                    var view = new ViewHostControl {
                        View = new UserControl()
                    };
                    var viewGroup = new ViewGroup();
                    viewGroup.Push(new View("view1")
                    {
                        ViewHostInstance = view
                    });
                    _workspaceAdapter.PerformUIActivation(null, viewGroup.Peek()).Wait();

                    // Act
                    _workspaceAdapter.PerformUIActivation(null, viewGroup.Peek()).Wait();

                    // Verify
                    Assert.IsTrue(((ViewGroupHostControl)_workspace.Children[0]).Views.Count == 1);
                });
            }
예제 #3
0
            public void ActivatingWindowThrowsException()
            {
                _uiTestHelper.ExecuteOnUIThread(() =>
                {
                    // Prepare
                    var view = new ViewHostControl {
                        View = new Window()
                    };
                    var viewGroup = new ViewGroup();
                    viewGroup.Push(new View("view1")
                    {
                        ViewHostInstance = view
                    });

                    // Act
                    _workspaceAdapter.PerformUIActivation(null, viewGroup.Peek()).Wait();

                    // Verify
                });
            }