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;
 }
Ejemplo n.º 2
0
        public StartupViewModelTests()
        {
            _screen = new Screen();
            _navigation = new Mock<INavigationService>();

            _viewModel = new StartupViewModel(
                new[] {_screen}, _navigation.Object);
        }
Ejemplo n.º 3
0
 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;
        }
Ejemplo n.º 5
0
 public ToastProvider(Screen s)
 {
     this.screen = s;
       try
       {
     this.windowManager = IoC.Get<IWindowManager>();
       }
       catch
       {
     this.windowManager = new WindowManager();
       }
 }
Ejemplo 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;
 }
Ejemplo n.º 10
0
 public void NavigateToScreen(Screen screen)
 {
     EventAggregator.Publish(screen);
 }
Ejemplo 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();
                    //}
                }
                
                
            }
Ejemplo 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;
 }
Ejemplo n.º 15
-1
 public DesignerViewModel(Screen parentScreen)
 {
     _parentScreen = parentScreen;
     LoadedForkTale = new ForkTale();
 }
Ejemplo n.º 16
-1
 public MDIViewModel(SimpleContainer container) {
     this.Master = container.GetInstance<SettingViewModel>();
     this.Detail = container.GetInstance<TabViewModel>();
 }