void ShowPublicationInfo(object sender, PublicationSelectedArgs args) { // if we're already displaying a publication info grid, remove it var children = grid.Children.OfType <InfoGrid>().ToArray(); foreach (var child in children) { grid.Children.Remove(child); } var view = new InfoGrid(args.Publication); Grid.SetRow(view, 0); Grid.SetRowSpan(view, 3); Grid.SetZIndex(view, 10); grid.Children.Add(view); view.EmailSent += delegate { FlashMessage("Email Sent!", Brushes.LightGreen); }; view.Done += delegate { grid.Children.Remove(view); }; }
void ShowPublicationInfo(object sender, PublicationSelectedArgs args) { // if we're already displaying a publication info grid, remove it var children = grid.Children.OfType<InfoGrid>().ToArray(); foreach (var child in children) { grid.Children.Remove(child); } var view = new InfoGrid(args.Publication); Grid.SetRow(view, 0); Grid.SetRowSpan(view, 3); Grid.SetZIndex(view, 10); grid.Children.Add(view); view.EmailSent += delegate { FlashMessage("Email Sent!", Brushes.LightGreen); }; view.Done += delegate { grid.Children.Remove(view); }; }