Ejemplo n.º 1
0
        //--------------------------------------------------------------
        public TestDockTabItemViewModel()
        {
            DisplayName = "TestView";
            base.DockId = DockId;
            Icon = EditorHelper.GetPackedBitmap("pack://application:,,,/DigitalRune.Editor;component/Resources/Images/Icons.png", 32, 96, 32, 32);

            PrintPreviewCommand = new DelegateCommand(ShowPrintPreview);
            PrintCommand = new DelegateCommand(Print);
        }
Ejemplo n.º 2
0
        public DialogViewModel()
        {
            OkCommand = new DelegateCommand(Ok);
            CancelCommand = new DelegateCommand(Cancel);

            if (WindowsHelper.IsInDesignMode)
            {
                DisplayName = "Dialog title!";
                Content = "This is the dialog content.\n...";
            }
        }
Ejemplo n.º 3
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="ReloadFileViewModel"/> class.
        /// </summary>
        public ReloadFileViewModel()
        {
            if (WindowsHelper.IsInDesignMode)
            {
                _fileName = @"Drive:\Path\Filename";
            }

            YesCommand = new DelegateCommand(Yes);
            YesToAllCommand = new DelegateCommand(YesToAll);
            NoCommand = new DelegateCommand(No);
            NoToAllCommand = new DelegateCommand(NoToAll);
        }
Ejemplo n.º 4
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="SaveChangesViewModel"/> class.
        /// </summary>
        public SaveChangesViewModel()
        {
            if (WindowsHelper.IsInDesignMode)
            {
                ModifiedDocuments = new[] {
                    new DesignTimeDocument(),
                    new DesignTimeDocument(),
                    new DesignTimeDocument(),
                };
            }

            YesCommand = new DelegateCommand(Yes);
            NoCommand = new DelegateCommand(No);
            CancelCommand = new DelegateCommand(Cancel);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds the Quick Launch items for accessing options pages.
        /// </summary>
        private void AddQuickLaunchItems()
        {
            var quickLaunchService = Editor.Services.GetInstance<IQuickLaunchService>();
            if (quickLaunchService == null)
                return;

            var command = new DelegateCommand<MergeableNode<OptionsPageViewModel>>(Show);
            var quickLaunchItems = Options.OptionsNodes
                                          .SelectMany(optionsNode => optionsNode.GetSubtree(true))
                                          .Select(optionsNode => new QuickLaunchItem
                                          {
                                              Icon = MultiColorGlyphs.Options,
                                              Title = GetTitle(optionsNode),
                                              Command = command,
                                              CommandParameter = optionsNode,
                                              Tag = this
                                          });

            quickLaunchService.Items.AddRange(quickLaunchItems);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GoToLineViewModel"/> class.
 /// </summary>
 public GoToLineViewModel()
 {
     DisplayName = "Go To Line";
     OkCommand = new DelegateCommand(Ok, CanOk);
     CancelCommand = new DelegateCommand(Cancel);
 }
Ejemplo n.º 7
0
 public TestOptionsPageViewModel(string name)
     : base(name)
 {
     ClickCommand = new DelegateCommand(() => MessageBox.Show("Button clicked."));
 }
Ejemplo n.º 8
0
 //--------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="SaveLayoutViewModel"/> class.
 /// </summary>
 public SaveLayoutViewModel()
 {
     OkCommand = new DelegateCommand(Ok, CanOk);
     CancelCommand = new DelegateCommand(Cancel);
 }
Ejemplo n.º 9
0
 public SaveChangesViewModel()
 {
     SaveCommand = new DelegateCommand(Save);
     DiscardCommand = new DelegateCommand(Discard);
     CancelCommand = new DelegateCommand(Cancel);
 }