Beispiel #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public AccountManager()
        {
            InitializeComponent();

            Logic_Layer.Account account = new Logic_Layer.Account();

            DataContext = account;

            this.Account = account;
        }
Beispiel #2
0
        /// <summary>
        /// Contructor for editing an existing object
        /// </summary>
        /// <param name="account"></param>
        public AccountManager(Logic_Layer.Account account)
        {
            InitializeComponent();

            DataContext = account;

            this.Account = account;

            // We cant edit the primary key, disable it
            tbNumber.IsEnabled = false;

            // Disable validation for account id
            Binding binding = BindingOperations.GetBinding(tbNumber, TextBox.TextProperty);

            binding.ValidationRules.Clear();
        }