private void Application_Startup(object sender, StartupEventArgs e) { MatlConcrete m = new MatlConcrete(); m.Name = "Name from the model!"; m.Description = "Testing"; m.CompressiveStrength28 = 1.0; m.InitialCompressiveStrength = 2.0; m.CoeffThermalExpansion = 3.0; m.DensityDeadLoad = 4.0; MainWindowView vw = new MainWindowView(); MainWindowViewModel vm = new MainWindowViewModel(m); vw.DataContext = vm; vw.Show(); }
public MainWindowViewModel(MatlConcrete m) { m_GridRowCollection = new ObservableCollection <DataGridRowViewModel>(); m_AddGridRowCommand = new DelegateCommand(OnAddGridRowCommand); m_DuplicateGridRowCommand = new DelegateCommand(OnDuplicateGridRowCommand, () => { return(m_SelectedGridRow != null); }); m_DeleteGridRowCommand = new DelegateCommand(OnDeleteGridRowCommand, () => { return(m_SelectedGridRow != null); }); m_OkCommand = new DelegateCommand(OnOkCommand); m_ApplyCommand = new DelegateCommand(OnApplyCommand); m_CancelCommand = new DelegateCommand(OnCancelCommand); this.Name = m.Name; this.Description = m.Description; this.CompressiveStrength28 = m.CompressiveStrength28; this.InitialCompressiveStrength = m.InitialCompressiveStrength; this.CoeffThermalExpansion = m.CoeffThermalExpansion; this.DensityDeadLoad = m.DensityDeadLoad; m_Data = m; }