Exemple #1
0
        private void btnEditController_Click(object sender, RoutedEventArgs e)
        {
            ControllerConfigPopup popup = new ControllerConfigPopup();

            popup.DataContext = new ControllerPopupViewModel()
            {
                CurrentController = vm.SelectedController
            };
            popup.ShowDialog();
        }
Exemple #2
0
        private void btnEditController_Click(object sender, RoutedEventArgs e)
        {
            ControllerConfigPopup popup = new ControllerConfigPopup();

            popup.DataContext = new ControllerPopupViewModel()
            {
                CurrentController = (Model.ControllersRow)((System.Data.DataRowView)ControllerGrid.SelectedValue).Row
            };
            popup.ShowDialog();
        }
Exemple #3
0
        private void btnAddNewController_Click(object sender, RoutedEventArgs e)
        {
            ControllerConfigPopup popup = new ControllerConfigPopup();
            var vm = this.DataContext as MainWindowViewModel;

            Model.ControllersRow NewRow = vm.ActiveModel.Controllers.NewControllersRow();
            NewRow.Name    = "New Controller";
            NewRow.Address = "";
            NewRow.Type    = null;
            vm.ActiveModel.Controllers.AddControllersRow(NewRow);
            popup.DataContext = new ControllerPopupViewModel()
            {
                CurrentController = NewRow,
            };
            popup.ShowDialog();
        }