private void cancelProfile_Click(object sender, RoutedEventArgs e) { MainWindow main = new MainWindow(); ProfileSection ps = new ProfileSection(); AdditionalProfileInfo adproinfo = new AdditionalProfileInfo(null, null); CreateProfile cp = new CreateProfile(""); //this.NavigationService.Navigate(new MyMB("", Visibility, Visibility, Visibility, "")); MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Cancel Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { this.NavigationService.Navigate(new ProfileSection()); //ps.profile.Visibility = Visibility.Visible; //ps.profileinfo.Visibility = Visibility.Visible; //createProfile.Visibility = Visibility.Hidden; createprofileinfo.Visibility = Visibility.Hidden; //createProfile2.Visibility = Visibility.Hidden; //createprofileinfo2.Visibility = Visibility.Hidden; //adproinfo.AdditonalProfile.Visibility = Visibility.Hidden; adproinfo.GridAdditionalProfileInfo.Visibility = Visibility.Hidden; adproinfo.ClearAllTextboxProfile(); } //main.MyMessageBox("Are you sure want to cancel?", Visibility.Visible, Visibility.Visible, Visibility.Hidden, "ProfileSection"); // Change the page of the frame. //if (pageFrame != null) //{ // this.NavigationService.Navigate(new ProfileSection("profile")); //} //main.MyMessageBox("Are you sure?", Visibility.Visible, Visibility.Visible, Visibility.Hidden, "cancelProfile"); }
//WebBrowser webBrowser1 = new WebBrowser(); public MainWindow() { var result = ValidateLicence.validateLicnece(); if (result.Contains("Valid:1")) { InitializeComponent(); Consumo consumo = new Consumo(); DataContext = new ConsumoViewModel(consumo); AdditionalProfileInfo adproinfo = new AdditionalProfileInfo(null, null); adproinfo.RefreshProfiles(); frame.Visibility = Visibility.Visible; frame.NavigationService.Navigate(new Dashboardndex()); } else { if (result.Contains("network-related")) { this.Hide(); MessageBox.Show("Please Check Your Internet Connection."); return; } this.Hide(); Licence.Licence win2 = new Dashboard1.Licence.Licence(); win2.Activate(); win2.Show(); } }