void od_Closed(object sender, EventArgs e) { OpenDash od = sender as OpenDash; try { if (od.DialogResult == true) { applicationViewModel.GadgetsOnCanvas = true; applicationViewModel.ReadAllUsersInMyOrg(); //Share.Visibility = System.Windows.Visibility.Visible; //Delete.Visibility = System.Windows.Visibility.Visible; } } catch (Exception) { } finally { od.Closed -= new EventHandler(od_Closed); od = null; sender = null; } }
private void Open_Click(object sender, RoutedEventArgs e) { OpenDash od = new OpenDash(); od.Show(); od.Closed += new EventHandler(od_Closed); //int i = 0; ////UnloadedEvent(); //applicationViewModel.LoadCanvas(i); }