//-------------------------------------------------------------- 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); }
public DialogViewModel() { OkCommand = new DelegateCommand(Ok); CancelCommand = new DelegateCommand(Cancel); if (WindowsHelper.IsInDesignMode) { DisplayName = "Dialog title!"; Content = "This is the dialog content.\n..."; } }
//-------------------------------------------------------------- /// <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); }
//-------------------------------------------------------------- /// <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); }
/// <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); }
/// <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); }
public TestOptionsPageViewModel(string name) : base(name) { ClickCommand = new DelegateCommand(() => MessageBox.Show("Button clicked.")); }
//-------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="SaveLayoutViewModel"/> class. /// </summary> public SaveLayoutViewModel() { OkCommand = new DelegateCommand(Ok, CanOk); CancelCommand = new DelegateCommand(Cancel); }
public SaveChangesViewModel() { SaveCommand = new DelegateCommand(Save); DiscardCommand = new DelegateCommand(Discard); CancelCommand = new DelegateCommand(Cancel); }