private void OnLoginChildWindowShow(object sender, EventArgs e) { if (sender == null) return; var loginChildWindow = sender as LoginChildWindow; if (loginChildWindow == null || loginChildWindow.DialogResult != true) return; _ingageApi = new Api(loginChildWindow.Login, loginChildWindow.Password, ApiKey); if (_ingageApi == null) return; App.ApiInstance = _ingageApi; // Set the data context of the listbox control to the sample data DataContext = App.ViewModel; App.ViewModel.LoadData(); }
public MainViewModel(Api apiInstance) { _apiInstance = apiInstance; Items = new ObservableCollection<ItemViewModel>(); }