当前位置: 首页>>代码示例>>C#>>正文


C# MainViewModel.ShowChildWindow方法代码示例

本文整理汇总了C#中MainViewModel.ShowChildWindow方法的典型用法代码示例。如果您正苦于以下问题:C# MainViewModel.ShowChildWindow方法的具体用法?C# MainViewModel.ShowChildWindow怎么用?C# MainViewModel.ShowChildWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainViewModel的用法示例。


在下文中一共展示了MainViewModel.ShowChildWindow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WhenShowParentWindow_ItActivates

        public void WhenShowParentWindow_ItActivates()
        {
            //Arrange
            var eventAggregator = Mock.Create<IEventAggregator>(Behavior.Loose);
            var mainVM = new MainViewModel { EventAggregator = eventAggregator };
            var parentWindow = new BaseTopLevelWindow();
            var childWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);

            Mock.Arrange(() => childWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());

            mainVM.Windows.Add(parentWindow);
            mainVM.ShowChildWindow(parentWindow, childWindow);

            // Act
            mainVM.ShowParentWindow(parentWindow);

            //Assert
            Assert.AreEqual(parentWindow, mainVM.SelectedWindow);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:19,代码来源:MainViewModelTests.cs

示例2: WhenCreateNewItemFromChecklist_AnswerDetailsIsAlsoParentWindow

        /// <summary>
        /// Whens the create new item from checklist_ answer details is also parent window.
        /// <author>Unknown</author>.
        /// </summary>
        /// [TestMethod]
        public void WhenCreateNewItemFromChecklist_AnswerDetailsIsAlsoParentWindow()
        {
            var eventAggregator = Mock.Create<IEventAggregator>();
            var mainVM = new MainViewModel { EventAggregator = eventAggregator };
            var window1 = new BaseTopLevelWindow();
            var window2 = Mock.Create<ITopLevelWindow>();
            var window3 = Mock.Create<ITopLevelWindow>();
            var childWindow = Mock.Create<ITopLevelWindow>();

            Mock.Arrange(() => window3.ParentWindow).Returns(window2);

            Mock.Arrange(() => childWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());

            mainVM.Windows.Add(window1);
            mainVM.Windows.Add(window2);

            mainVM.ShowChildWindow(window3, childWindow);

            Assert.IsNotNull(mainVM.SelectedWindow);
            Assert.IsTrue(childWindow.IsVisible);
            Assert.IsTrue(childWindow.IsSelected);
            Assert.AreEqual(childWindow.ParentWindow, window2);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:28,代码来源:MainViewModelTests.cs

示例3: WhenShowChildWindow_TitleCopiedToOriginalTitle

        public void WhenShowChildWindow_TitleCopiedToOriginalTitle()
        {
            //Arrange
            var eventAggregator = Mock.Create<IEventAggregator>(Behavior.Loose);
            var mainVM = new MainViewModel { EventAggregator = eventAggregator };
            var parentWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            var childWindow = new BaseTopLevelWindow();
            mainVM.Windows.Add(parentWindow);
            Mock.Arrange(() => parentWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());
            var title = Guid.NewGuid().ToString();
            childWindow.Title = title;

            // Act
            mainVM.ShowChildWindow(parentWindow, childWindow);

            //Assert
            Assert.AreEqual(title, childWindow.OriginalTitle);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:18,代码来源:MainViewModelTests.cs

示例4: AfterShowGrandChildWindow_BreadCrumbsCountIncreases

        public void AfterShowGrandChildWindow_BreadCrumbsCountIncreases()
        {
            // Arrange
            var eventAggregator = Mock.Create<IEventAggregator>(Behavior.Loose);
            var mainVM = new MainViewModel { EventAggregator = eventAggregator };
            var parentWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            var childWindow = new BaseTopLevelWindow();
            var grandChildWindow = new BaseTopLevelWindow();

            mainVM.Windows.Add(parentWindow);
            Mock.Arrange(() => parentWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());

            //Act
            mainVM.ShowChildWindow(parentWindow, childWindow);
            mainVM.ShowChildWindow(childWindow, grandChildWindow);

            // Assert
            Assert.AreEqual(grandChildWindow.Breadcrumbs.Count, 3);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:19,代码来源:MainViewModelTests.cs

示例5: AfterShowChildWindow_ParentWindowIsInvisible

        public void AfterShowChildWindow_ParentWindowIsInvisible()
        {
            // Arrange
            var eventAggregator = Mock.Create<IEventAggregator>(Behavior.Loose);
            var mainVM = new MainViewModel { EventAggregator = eventAggregator };
            var parentWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            var childWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            mainVM.Windows.Add(parentWindow);
            Mock.Arrange(() => parentWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());
            Mock.Arrange(() => childWindow.Breadcrumbs).Returns(new ObservableCollection<IBreadcrumbItem>());

            //Act
            mainVM.ShowChildWindow(parentWindow, childWindow);

            // Assert
            Assert.IsFalse(parentWindow.IsVisible);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:17,代码来源:MainViewModelTests.cs

示例6: WhenPassWindowNotInWindowsCollection_ThrowsException

 public void WhenPassWindowNotInWindowsCollection_ThrowsException()
 {
     var mainVM = new MainViewModel();
     var parentWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
     var childWindow = Mock.Create<ITopLevelWindow>(Behavior.Loose);
     mainVM.ShowChildWindow(parentWindow, childWindow);
 }
开发者ID:mparsin,项目名称:Elements,代码行数:7,代码来源:MainViewModelTests.cs

示例7: WhenPassNullParentWindowToShowChildWindow_ThrowsException

 public void WhenPassNullParentWindowToShowChildWindow_ThrowsException()
 {
     var mainVM = new MainViewModel();
     var window1 = Mock.Create<ITopLevelWindow>(Behavior.Loose);
     mainVM.ShowChildWindow(null, window1);
 }
开发者ID:mparsin,项目名称:Elements,代码行数:6,代码来源:MainViewModelTests.cs


注:本文中的MainViewModel.ShowChildWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。