/// <summary> /// ニュースを登録ボタンが押されたときに呼ばれます。 /// </summary> /// <param name="sender">sender</param> /// <param name="e">e</param> private void AddNewsButtonClick(object sender, RoutedEventArgs e) { var childView = new NewsRegisterView(); var childViewModel = new NewsRegisterViewModel(); childViewModel.UserId = this.viewModel.UserId; childViewModel.DisplayName = this.viewModel.DisplayName; childViewModel.AccessToken = this.viewModel.AccessToken; childView.DataContext = childViewModel; childView.Owner = this; childView.ShowDialog(); }
/// <summary> /// 画面が読み込まれた後に呼ばれます。 /// </summary> /// <param name="sender">sender</param> /// <param name="e">e</param> private async void ViewLoaded(object sender, RoutedEventArgs e) { this.viewModel = this.DataContext as NewsRegisterViewModel; this.viewModel.Author = this.viewModel.DisplayName; await this.GetNewsCategoryList(); }