private void Window_Closed(object sender, RoutedEventArgs e) { ActivationManager am = ActivationManager.GetInstance(); if (am.IsExipred() && !am.ActivationStatus()) { MessageBox.Show("Please register you have used your 30 days trial period\nThe application will now close"); Application.Current.Shutdown(); } }