Ejemplo n.º 1
0
        public WriteXmlTableEditorViewModel(IEditorViewModelFactory editorFactory)
        {
            _editorFactory = editorFactory;

            Title = "Write XML Table Task";

            Append  = true;
            Create  = WriteXmlCreateEnum.None;
            Table   = "name1";
            File    = "%installPath%";
            XPath   = "/";
            Element = "Element";

            AddAttributeCommand    = new DelegateCommand(AddAttribute, () => true);
            RemoveAttributeCommand = new DelegateCommand <AttributeEditorViewModel>(attribute => Attributes.Remove(attribute),
                                                                                    atttribute => Attributes.IndexOf(atttribute) > 0);

            Attributes.CollectionChanged += (sender, args) => OnUpdateSnippet();

            AddAttribute();

            Errors.Add(nameof(Table), new List <string>());
            Errors.Add(nameof(File), new List <string>());
            Errors.Add(nameof(XPath), new List <string>());
            Errors.Add(nameof(Element), new List <string>());
        }
Ejemplo n.º 2
0
        public ComboEditorViewModel(IEditorViewModelFactory editorFactory)
        {
            _editorFactory = editorFactory;

            Title = "ComboBox Control";

            AddItemCommand    = new DelegateCommand(AddItem, () => true);
            RemoveItemCommand = new DelegateCommand <ItemEditorViewModel>(item => Items.Remove(item), item => Items.IndexOf(item) > 0);

            Items.CollectionChanged += (sender, args) => OnUpdateSnippet();

            AddItem();
        }
        public RadioEditorViewModel(IEditorViewModelFactory editorFactory)
        {
            _editorFactory = editorFactory;

            Title = "RadioButton Control";

            AddChoiceCommand    = new DelegateCommand(AddChoice, () => true);
            RemoveChoiceCommand = new DelegateCommand <ChoiceEditorViewModel>(choice => Choices.Remove(choice), choice => Choices.IndexOf(choice) > 0);

            Choices.CollectionChanged += (sender, args) => OnUpdateSnippet();

            AddChoice();
        }
        public SnippetsFlyoutViewModel(IEditorViewModelFactory editorFactory)
        {
            _editorFactory = editorFactory;

            Title = "Snippets";
        }