Click here to Skip to main content
15,888,157 members
Articles / Desktop Programming / WPF

WPF Form Designer Prototype (MVVM)

Rate me:
Please Sign up or sign in to vote.
4.83/5 (31 votes)
3 Apr 2013CPOL9 min read 79.4K   3.4K   108  
Form designer with editable display properties and bindings. Generates XAML forms.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Xml.Serialization;
using SimpleMvvmToolkit;
using WPFFormDesigner.CommonUtils;

namespace WPFFormDesigner.WPFPropertyGridProxies
{
    public class WPFControlBindingModelBase : ModelBase<WPFControlBindingModelBase>
    {
        #region Declarations
        private List<string> _BindingModeList;
        private List<string> _UpdateSourceTriggerList;
        #endregion

        #region Constructors

        public WPFControlBindingModelBase()
        {
            BindingModeList = typeof(BindingMode).GetSortedEnumNames();
            UpdateSourceTriggerList = typeof(UpdateSourceTrigger).GetSortedEnumNames();
        }
        #endregion

        #region Public Properties
        [XmlIgnore]
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public List<string> BindingModeList
        {
            get { return _BindingModeList; }
            set
            {
                _BindingModeList = value;
                NotifyPropertyChanged(x => BindingModeList);
            }
        }

        [XmlIgnore]
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public List<string> UpdateSourceTriggerList
        {
            get { return _UpdateSourceTriggerList; }
            set
            {
                _UpdateSourceTriggerList = value;
                NotifyPropertyChanged(x => UpdateSourceTriggerList);
            }
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Sr. application developer currently developing desktop and web applications for the specialty insurance sector. Data integration specialist, interested in learning the latest .Net technologies.

Comments and Discussions