示例#1
0
        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;
 }
示例#3
0
 public SiteViewModel(Site siteModel)
 {
     this.site = siteModel;
 }
示例#4
0
 public ContactViewModel(MainWindow window, Site site, SiteViewModel siteViewModel)
 {
     this.window = window;
     this.site = site;
     this.siteViewModel = siteViewModel;
 }