public NozzleSettingsVM(ShowerVM vm)
        {
            try
            {
                _nozzles    = vm.Nozzles;
                Nozzledata  = StaticData.Nozzledata;
                NozzleTypes = vm.NozzleTypes;

                NozzleTypes.CollectionChanged   += NozzleTypes_CollectionChanged;
                NozzleTypes.ItemPropertyChanged += NozzleTypes_ItemPropertyChanged;

                _numnozzles = vm.Nozzles.Count;
                if (Nozzles.Count == 0)
                {
                    NumNozzles = 1;
                }
            }
            catch
            {
                MessageBox.Show("The nozzle settings cannot be loaded.", "Unable to load nozzle settings", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                CloseWindowFlag = true;
            }
            if (vm.NozzleTypes.Count == 0)
            {
                MessageBox.Show("The nozzle types cannot be loaded.", "Unable to load nozzle types", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                CloseWindowFlag = true;
            }

            MaximumNozzleToYankee = vm.MaximumNozzleToYankee;
        }
        public void OpenNozzlesDlg2(ViewModels.ShowerVM vm)
        {
            Window _owner;

            _owner = Application.Current.Windows[0];
            Views.NozzleSettings dlg = new Views.NozzleSettings(vm)
            {
                Owner = _owner
            };
            dlg.ShowDialog();
        }
Beispiel #3
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModels.ShowerVM();
 }