private async void AddBtn_Click(object sender, RoutedEventArgs e) { keywordControl = new KeywordControl(); if (keywordControl.ViewModel.KeywordsCategory.Count == 0) { keywordControl.ViewModel.KeywordsCategory.AddRange(await BlockEntryCreateModel.InitCategory()); } keywordControl.Show(); keywordControl.AddRecordClick += KeywordControl_Refresh; }
//private async void EditBtn_Click(object sender, RoutedEventArgs e) //{ // var block = ResultList.Where(x => x.selected).FirstOrDefault(); // if (block != null) // { // keywordControl = new KeywordControl(block); // if(keywordControl.ViewModel.KeywordsCategory.Count == 0) // keywordControl.ViewModel.KeywordsCategory.AddRange(await BlockEntryCreateModel.InitCategory()); // keywordControl.Show(); // keywordControl.AddRecordClick += KeywordControl_Refresh; // } //} private async void BlockEntryControl_EditClicked(object sender, ItemClickEventArgs e) { try { BlockEntry block = (sender as Button).DataContext as BlockEntry; if (block != null) { keywordControl = new KeywordControl(block); if (keywordControl.ViewModel.KeywordsCategory.Count == 0) { keywordControl.ViewModel.KeywordsCategory.AddRange(await BlockEntryCreateModel.InitCategory()); } keywordControl.Show(); keywordControl.AddRecordClick += KeywordControl_Refresh; } } catch (Exception ex) { MainPage.ShowErrorMessage(ex.Message); } }