private void OnStartup(object sender, StartupEventArgs e) { //OperatorImage temp = new OperatorImage(); Site site = new Site { PhoneNumber = "", SMSText = "" }; MainWindow window = new MainWindow(); SiteViewModel siteViewModel = new SiteViewModel(site); HistoryViewModel historyViewModel = new HistoryViewModel(site); MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(site); ContactViewModel contactViewModel = new ContactViewModel(window, site, siteViewModel); window.smsTab.DataContext = siteViewModel; window.historyTab.DataContext = historyViewModel; window.contactTab.DataContext = contactViewModel; window.mainWindow.DataContext = mainWindowViewModel; window.Show(); }
public MainWindowViewModel(Site siteModel) { this.site = siteModel; }
public SiteViewModel(Site siteModel) { this.site = siteModel; }
public ContactViewModel(MainWindow window, Site site, SiteViewModel siteViewModel) { this.window = window; this.site = site; this.siteViewModel = siteViewModel; }