Пример #1
0
        protected ModalViewModel(Window window, string caption)
        {
            Caption = caption;

            Window             = window;
            CloseWindowCommand = SimpleCommand.From(Window.Close);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
 }
Пример #6
0
 public static void Register()
 {
     JamModals.ConfirmResetDataCommand = SimpleCommand.From(ConfirmResetDataModal.ShowModal);
 }
Пример #7
0
 public ConfirmResetDataViewModel(Window window)
     : base(window, "Reset user data")
 {
     ResetUserDataCommand = SimpleCommand.From(ResetUserData);
 }