private static void UIActivate(MainWindow mainAppwindow) { MainAppwindow = mainAppwindow; mainUIModel = new Models.MainUIModel(); var ctrlMain = new UI.CtrlMain(); ctrlMain.DataContext = new Models.MainUIViewModel(mainUIModel); mainAppwindow.SetUserName(Authorization.CurentUser.FullName); mainAppwindow.SetMainControl(ctrlMain); mainAppwindow.Closing += MainAppwindow_Closing; }
public MainUIViewModel(MainUIModel _model) { model = _model; model.BusyStarted += new EventHandler((sender, e) => { IsBusy = true; }); model.BusyStoped += new EventHandler((sender, e) => { IsBusy = false; }); model.BusyMessageSended += new EventHandler <string>((sender, s) => { InvokeOnUIThread(() => { this.BusyContent = s; }); }); }