//For the case that you are selecting a review to edit in the sort page. public ReviewPage(LocalDataManager LocalData, ReviewObject Review_To_Edit, Edit_Window Edit_Window) { InitializeComponent(); this.LocalData = LocalData; Parent_Window = Edit_Window; //Make the right buuttons visible. Submit_Button.Visibility = Visibility.Hidden; Update_Button.Visibility = Visibility.Visible; //Since this is the update constructor we need to store old info. oldReview = new ReviewObject(Review_To_Edit); currentReview = Review_To_Edit; //Set the field values ot be equual to the review so you are "viewing" the contents of the review. TitleBox.Text = Review_To_Edit.Title; AlbumName.Text = Review_To_Edit.Album; YearBox.Text = Review_To_Edit.Release_Date.ToString(); Artist_NameBox.Text = Review_To_Edit.Artist; ReviewBox.Text = Review_To_Edit.Review; FileNameLabel.Content = Review_To_Edit.File_Path; ScoreBox.Text = Review_To_Edit.Rating.ToString(); //Update the Tags list; UpdateReviewTags(); }
private void TableView_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) { ListView View = (sender as ListView); if (View.SelectedItem is Review_Reference) { ReviewObject Review_To_Edit = this.LocalData.DBManager.GetReview((View.SelectedItem as Review_Reference)); Review_To_Edit.setTags(LocalData.DBManager.GetTagsForReview(View.SelectedItem as Review_Reference)); if (Review_To_Edit != null) //This can happen if you double on the main page but not on a row of the table. { Edit_Window Edit_Window = new Edit_Window(this.LocalData, Review_To_Edit); Edit_Window.ShowDialog(); Edit_Window = null; GC.Collect(); GC.WaitForFullGCComplete(); } Review_To_Edit = null; } }