Create custom wpf event
i've created an UserControl for Database connection where user input Username and Password for a connection. This UserControl is in a MainWindow.xaml Now, in code behind of my UserControl i create a MSSQL connection. If login Successfully, i want to Raise a custom event to expose in MainWindow. For example in MyUserControl.xaml.cs try { using (SqlConnection sqlConn = new SqlConnection(connection)) { sqlConn.Open(); MessageBox.Show("Connessione Riuscita!", "Connessione a " + TextIP.Text, MessageBoxButton.OK, MessageBoxImage.Information); RaiseMyEvent(); sqlConn.Close(); } } catch (SqlException