/// <summary>
        /// Initializes a new instance of the <see cref="ImageUploadViewModel"/> class
        /// </summary>
        /// <param name="templateGeneratorView">Parent view</param>
        public ImageUploadViewModel(TemplateGeneratorView templateGeneratorView)
        {
            // init view
            this.view = new ImageUploadView(this, templateGeneratorView);

            this.SelectImagesCommand = new RelayCommand(x => this.OnSelectImages());
            this.UploadImagesCommand = new RelayCommand(x => this.OnUploadImages());
            this.CloseCommand        = new RelayCommand(x => this.OnCloseCommand());

            this.view.ShowDialog();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TemplateGeneratorViewModel"/> class
        /// </summary>
        public TemplateGeneratorViewModel()
        {
            // init commands
            this.UploadImagesCommand   = new RelayCommand(x => this.UploadImages());
            this.GenerateCommand       = new RelayCommand(x => this.OnGenerateCommand());
            this.CloseCommand          = new RelayCommand(x => this.OnCloseCommand());
            this.LoadFromFileCommand   = new RelayCommand(x => this.LoadDescriptionFromFile());
            this.SaveMarkupFileCommand = new RelayCommand(x => this.SaveDescriptionToFile(), x => !string.IsNullOrEmpty(this.TemplateDescription));

            this.SetDefaultVisuals();

            // init view
            this.view = new TemplateGeneratorView(this);

            // display view
            this.view.ShowDialog();
        }