public MessageBoxViewModel(string title, IDialogView view, IView contentView) { View = view; View.Model = this; ContentView = contentView; Title = title; CloseWindowCommand = new DelegateCommand(Close); MoveWindowCommand = new DelegateCommand(() => { View.DragMove(); }); }
/// <summary> /// Initializes a new instance of the <see cref="MessageBoxViewModel"/> class. /// </summary> /// <remarks>This is a private constructor, use the static method Show to create MessageBox instances.</remarks> /// <param name="title">The title.</param> /// <param name="message">The message.</param> /// <param name="buttons">The buttons.</param> /// <param name="imageSource">The image source.</param> /// <param name="isErrorAlert">if set to <c>true</c> [is error alert].</param> public MessageBoxViewModel(string title, string message, System.Windows.MessageBoxButton buttons, string imageSource, IDialogView view) { View = view; View.Model = this; Title = title; Message = message; Buttons = buttons; if (imageSource != null) ImageSource = imageSource; else ResetErrorImage(); ResultButtonPressedCommand = new DelegateCommand<string>(OnResultButtonPressed); CloseWindowCommand = new DelegateCommand(Close); MoveWindowCommand = new DelegateCommand(() => { View.DragMove(); }); }