protected ModalViewModel(Window window, string caption) { Caption = caption; Window = window; CloseWindowCommand = SimpleCommand.From(Window.Close); }
public ExporterViewModel(Exporter model) : base(model) { Options = new ExportOptionsViewModel(model.Options); ExportedTextProperty = WrapperProperty.Create( this, nameof(ExportedText), vm => vm.Model.ExportedText, (vm, value) => vm.Model.ExportedText = value ); GenerateTextCommand = SimpleCommand.From(GenerateText); CopyTextCommand = SimpleCommand.From(CopyText); }
public JamEntryViewModel(JamEntry model) : base(model) { Team = new JamTeamViewModel(model.Team); ThumbnailPathProperty = ImageSourceProperty.CreateReadonly(this, nameof(Thumbnail), vm => vm.Model.ThumbnailPath); ThumbnailSmallPathProperty = ImageSourceProperty.CreateReadonly(this, nameof(ThumbnailSmall), vm => vm.Model.ThumbnailSmallPath); Launcher = new ProcessLauncher(); LaunchGameCommand = SimpleCommand.From(LaunchGame); OpenReadmeCommand = ReadmePath != null && !model.IsReadmePlease ? SimpleCommand.From(OpenReadme) : null; OpenReadmePleaseCommand = ReadmePath != null && model.IsReadmePlease ? SimpleCommand.From(OpenReadme) : null; OpenAfterwordCommand = AfterwordPath != null?SimpleCommand.From(OpenAfterword) : null; OpenDirectoryCommand = SimpleCommand.From(OpenDirectory); }
public ExportOptionsViewModel(ExportOptions model) : base(model) { ReviewsTitleProperty = WrapperProperty.Create( this, nameof(ReviewsTitle), vm => vm.Model.ReviewsTitle, (vm, value) => vm.Model.ReviewsTitle = value ); ExportIncompleteRankingsProperty = WrapperProperty.Create( this, nameof(ExportIncompleteRankings), vm => vm.Model.ExportIncompleteRankings, (vm, value) => vm.Model.ExportIncompleteRankings = value ); EntryCommentTemplateProperty = WrapperProperty.Create( this, nameof(EntryCommentTemplate), vm => vm.Model.EntryCommentTemplate, (vm, value) => vm.Model.EntryCommentTemplate = value ); RestoreDefaultsCommand = SimpleCommand.From(RestoreDefaults); }
public static void Register() { ExportModals.ShowHelpCommand = SimpleCommand.From(ExportHelpModal.ShowModal); }
public static void Register() { JamModals.ConfirmResetDataCommand = SimpleCommand.From(ConfirmResetDataModal.ShowModal); }
public ConfirmResetDataViewModel(Window window) : base(window, "Reset user data") { ResetUserDataCommand = SimpleCommand.From(ResetUserData); }