示例#1
0
        public SourceManagerView(string heading)
        {
            InitializeComponent();
            ConfigureHeading(heading);

            _buttonBar = this.ButtonBar as DefaultModalButtonBar;
            Debug.Assert(_buttonBar != null, "The this.ButtonBar must be an DefaultModalButtonBar");
            _buttonBar.OkButton.SetBinding(Button.CommandProperty, new Binding("SaveCommand"));
            _buttonBar.CancelButton.SetBinding(Button.CommandProperty, new Binding("CancelCommand"));

            this.DataContextChanged += new DependencyPropertyChangedEventHandler(SourceManagerView_DataContextChanged);
        }
        public SourceManagerView(string heading)
        {
            InitializeComponent();
            ConfigureHeading(heading);

            _buttonBar = this.ButtonBar as DefaultModalButtonBar;
            Debug.Assert(_buttonBar != null, "The this.ButtonBar must be an DefaultModalButtonBar");
            _buttonBar.OkButton.SetBinding(Button.CommandProperty, new Binding("SaveCommand"));
            _buttonBar.CancelButton.SetBinding(Button.CommandProperty, new Binding("CancelCommand"));

            this.DataContextChanged += new DependencyPropertyChangedEventHandler(SourceManagerView_DataContextChanged);
        }