Example #1
0
        /// <summary>
        /// ShowDockingPaneCommand executed. Publishes the ShowViewModelRequestEvent, so that this view model is
        /// opened in the application.
        /// </summary>
        protected virtual void ShowDockingPaneCommand_Executed()
        {
            ShowViewModelRequestEventArgs args = new ShowViewModelRequestEventArgs(this);

            args.DockingPaneAnchorStyle = this.DockingPaneAnchorStyle;
            args.DockingPaneStyle       = this.DockingPaneStyle;
            this.EventManager.GetEvent <ShowViewModelRequestEvent>().Publish(args);
        }
Example #2
0
        /// <summary>
        /// Reacts on ShowViewModelRequestEvent.
        /// </summary>
        /// <param name="args">Event data.</param>
        protected override void ShowViewModel(ShowViewModelRequestEventArgs args)
        {
            if (this.PackageController == null)
            {
                return;
            }

            if (this.PackageController.CurrentShellViewModel != this)
            {
                return;
            }

            this.PackageController.ShowViewModel(args);
        }
Example #3
0
 /// <summary>
 /// Show search options view model.
 /// </summary>
 private void ShowSearchOptionsViewModel()
 {
     if (!this.IsDockingPaneVisible)
     {
         // show docking pane
         ShowViewModelRequestEventArgs args = new ShowViewModelRequestEventArgs(this);
         args.DockingPaneStyle = ViewModel.DockingPaneStyle.Floating;
         this.EventManager.GetEvent <ShowViewModelRequestEvent>().Publish(args);
     }
     else
     {
         // bring to front
         this.EventManager.GetEvent <BringToFrontViewModelRequestEvent>().Publish(new BringToFrontViewModelRequestEventArgs(this));
     }
 }
Example #4
0
 /// <summary>
 /// Reacts on ShowViewModelRequestEvent.
 /// </summary>
 /// <param name="args">Event data.</param>
 public virtual void ShowViewModel(ShowViewModelRequestEventArgs args)
 {
     if (args.ViewName != null)
     {
         IDockableViewModel vm = this.LayoutManager.ShowWindow(args.ViewName, args.DockingPaneStyle, args.DockingPaneAnchorStyle);
         if (vm != null)
         {
             this.LayoutManager.BringToFrontWindow(vm);
             vm.IsDockingPaneVisible = true;
         }
     }
     else if (args.SourceViewModel is IDockableViewModel)
     {
         this.LayoutManager.ShowWindow(args.SourceViewModel as IDockableViewModel, args.DockingPaneStyle, args.DockingPaneAnchorStyle);
         this.LayoutManager.BringToFrontWindow(args.SourceViewModel as IDockableViewModel);
         (args.SourceViewModel as IDockableViewModel).IsDockingPaneVisible = true;
     }
 }
 /// <summary>
 /// ShowDockingPaneCommand executed. Publishes the ShowViewModelRequestEvent, so that this view model is
 /// opened in the application.
 /// </summary>
 protected virtual void ShowDockingPaneCommand_Executed()
 {
     ShowViewModelRequestEventArgs args = new ShowViewModelRequestEventArgs(this);
     args.DockingPaneAnchorStyle = this.DockingPaneAnchorStyle;
     args.DockingPaneStyle = this.DockingPaneStyle;
     this.EventManager.GetEvent<ShowViewModelRequestEvent>().Publish(args);
 }
        /// <summary>
        /// Reacts on ShowViewModelRequestEvent.
        /// </summary>
        /// <param name="args">Event data.</param>
        public virtual void ShowViewModel(ShowViewModelRequestEventArgs args)
        {

            if (args.ViewName != null)
            {
                IDockableViewModel vm = this.LayoutManager.ShowWindow(args.ViewName, args.DockingPaneStyle, args.DockingPaneAnchorStyle);
                if (vm != null)
                {
                    this.LayoutManager.BringToFrontWindow(vm);
                    vm.IsDockingPaneVisible = true;
                }
            }
            else if (args.SourceViewModel is IDockableViewModel)
            {
                this.LayoutManager.ShowWindow(args.SourceViewModel as IDockableViewModel, args.DockingPaneStyle, args.DockingPaneAnchorStyle);
                this.LayoutManager.BringToFrontWindow(args.SourceViewModel as IDockableViewModel);
                (args.SourceViewModel as IDockableViewModel).IsDockingPaneVisible = true;
            }
        }
 /// <summary>
 /// Reacts on ShowViewModelRequestEvent.
 /// </summary>
 /// <param name="args">Event data.</param>
 protected abstract void ShowViewModel(ShowViewModelRequestEventArgs args);
        /// <summary>
        /// Reacts on ShowViewModelRequestEvent.
        /// </summary>
        /// <param name="args">Event data.</param>
        protected override void ShowViewModel(ShowViewModelRequestEventArgs args)
        {
            if (this.PackageController == null)
                return;

            if (this.PackageController.CurrentShellViewModel != this)
                return;

            this.PackageController.ShowViewModel(args);
        }
 /// <summary>
 /// Show search options view model.
 /// </summary>
 private void ShowSearchOptionsViewModel()
 {
     if (!this.IsDockingPaneVisible)
     {
         // show docking pane
         ShowViewModelRequestEventArgs args = new ShowViewModelRequestEventArgs(this);
         args.DockingPaneStyle = ViewModel.DockingPaneStyle.Floating;
         this.EventManager.GetEvent<ShowViewModelRequestEvent>().Publish(args);
     }
     else
     {
         // bring to front
         this.EventManager.GetEvent<BringToFrontViewModelRequestEvent>().Publish(new BringToFrontViewModelRequestEventArgs(this));
     }
 }