A base implementation of IScreen.
Inheritance: ViewAware, IScreen, IChild
 public void SetScreen(Screen screen)
 {
     if (ScreenAvailable)
         throw new InvalidOperationException("Message already has a screen set of type " + Screen.GetType().Name);
     if (!TypeOfScreen.IsAssignableFrom(screen.GetType()))
         throw new InvalidOperationException("Screen {0} is incompatible with {1}".Fmt(screen.GetType().Name, TypeOfScreen.Name));
     Screen = screen;
 }
Esempio n. 2
0
        public StartupViewModelTests()
        {
            _screen = new Screen();
            _navigation = new Mock<INavigationService>();

            _viewModel = new StartupViewModel(
                new[] {_screen}, _navigation.Object);
        }
 public NewRegister(
     RegisterViewModel registerViewModel, 
     IWindowManager windowManager,
     Screen returnWindow)
 {
     _registerViewModel = registerViewModel;
     _windowManager = windowManager;
     _returnWindow = returnWindow;
 }
        private static Page GetPage(Screen vm) {
            var vmView = ViewLocator.LocateForModel(vm, null, null);
            if (vmView == null)
                throw new Exception("没有找到视图");
            ViewModelBinder.Bind(vm, vmView, null);

            var activator = vm as IActivate;
            if (activator != null)
                activator.Activate();

            return (Page)vmView;
        }
Esempio n. 5
0
 public ToastProvider(Screen s)
 {
     this.screen = s;
       try
       {
     this.windowManager = IoC.Get<IWindowManager>();
       }
       catch
       {
     this.windowManager = new WindowManager();
       }
 }
Esempio n. 6
0
        public void NavigateToScreen(Screen screen, bool endableIdleTimeout = false)
        {
            StopIdleTimeout();

            EventAggregator.Publish(screen);

            if (endableIdleTimeout)
                StartIdleTimeout();
        }
 public void Init(ViewModelBase defaultView)
 {
     this._defaultContent = defaultView;
     this.SetDefaultView();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ChangeMainScreenEvent"/> class
 /// </summary>
 /// <param name="screen">The screen to switch to</param>
 public ChangeMainScreenEvent(Screen screen)
 {
     this.Screen = screen;
 }
 public ActivateScreenMessage(Screen screen) {
     Screen = screen;
 }
Esempio n. 10
0
 public void NavigateToScreen(Screen screen)
 {
     EventAggregator.Publish(screen);
 }
Esempio n. 11
0
            private void BindViewModelAndPage(Screen screen, Page page)
            {
                ViewModelBinder.Bind(screen, page, screen);
                
                

                if (TheConductor != null)
                {
                    TheConductor.ActivateItem(screen);
                    //IActivate activator = screen as IActivate;
                    //if (activator != null)
                    //{
                    //    activator.Activate();
                    //}
                }
                
                
            }
Esempio n. 12
-1
 public TaskbarBlinkProvider(Screen s)
 {
     this.screen = s;
 }
 public void LoadModule2() {
     var screen = IoC.Get<AnotherViewModel>();
     Another = screen;
 }
 public ChildWindowBagItem(ChildWindowType windowType, Screen viewModel)
     : this()
 {
     WindowType = windowType;
     ViewModel = viewModel;
 }
Esempio n. 15
-1
 public DesignerViewModel(Screen parentScreen)
 {
     _parentScreen = parentScreen;
     LoadedForkTale = new ForkTale();
 }
Esempio n. 16
-1
 public MDIViewModel(SimpleContainer container) {
     this.Master = container.GetInstance<SettingViewModel>();
     this.Detail = container.GetInstance<TabViewModel>();
 }