private void button1_Click(object sender, RoutedEventArgs e) { textBlock1.Text = ""; OracleConnection oc = CommonMethods.GetConnection(); oc.Open(); OracleCommand ocmd = oc.CreateCommand(); ocmd.CommandText = String.Format("select PERSOON_ID, NAAM, ACHTERNAAM, EMAIL, WACHTWOORD, TELEFOON, POSTCODE, NATIONALITEIT, WOONPLAATS, ADRES from persoon where email = '{0}' AND wachtwoord = '{1}'", textBox1.Text, passwordBox1.Password); OracleDataReader odr = ocmd.ExecuteReader(); if (odr.HasRows) { while (odr.Read()) { Customer cust = new Customer(Decimal.ToInt32((decimal)odr[0]), (string)odr[1], (string)odr[2], (string)odr[3], (string)odr[4], (string)odr[5], (string)odr[6], (string)odr[7], (string)odr[8], (string)odr[9]); CommonMethods.loginUser = cust; } NavigationWindow nw = new NavigationWindow(); nw.ShowsNavigationUI = false; nw.Navigate(new HomePage()); nw.Show(); CommonMethods.GetWindow(this).Close(); } else { textBlock1.Text = "Oops!\nGeen gebruiker gevonden met deze gegevens."; } oc.Close(); }
void myAppStartup(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); NavigationWindow myNavigationWindow = new NavigationWindow(); myNavigationWindow.Navigate(new SampleViewer()); myNavigationWindow.Show(); }
private void bt1_Click(object sender, RoutedEventArgs e) { NavigationWindow window = new NavigationWindow(); SetWindowExTransparent(new WindowInteropHelper(window).Handle); window.Title = "Soon!"; Uri source = new Uri("http://www.google.com", UriKind.Absolute); window.Navigating += (o, args) => { customHis = customHis + ((NavigationWindow)o).CurrentSource; }; window.Navigated += (o, args) => { customHis = customHis + ((NavigationWindow)o).CurrentSource; MessageBox.Show(customHis.ToString()); }; window.Source = source; window.ShowsNavigationUI = false; window.Closing += (o, args) => { args.Cancel = true; ((NavigationWindow)o).Navigate(new Uri("http://www.softuni.bg", UriKind.Absolute)); IEnumerable back = window.BackStack; foreach (var vara in back) { MessageBox.Show(vara.ToString()); } }; //window.AllowsTransparency = true; //window.Opacity = 1; window.WindowStyle = WindowStyle.None; window.Show(); }
private void button5_Click(object sender, RoutedEventArgs e) { CommonMethods.loginUser = null; NavigationWindow nw = new NavigationWindow(); nw.Navigate(new LoginPage()); nw.Show(); CommonMethods.GetWindow(this).Close(); }
private void button1_Click(object sender, RoutedEventArgs e) { if (CheckBox(txtbx_Naam) && CheckBox(txtbx_Email) && !passwordBox1.Password.Trim().Equals("") && CheckBox(txtbx_Telefoon) && CheckBox(txtbx_Postcode) && CheckBox(txtbx_Nationaliteit) && CheckBox(txtbx_Adres) && CheckBox(txtbx_Woonplaats) && CheckBox(txtbx_Achternaam)) { OracleConnection oc = CommonMethods.GetConnection(); oc.Open(); OracleCommand ocmd = oc.CreateCommand(); ocmd.CommandText = String.Format("SELECT PERSOON_ID FROM PERSOON WHERE email = '{0}'", txtbx_Email.Text); OracleDataReader odr = ocmd.ExecuteReader(); if (odr.HasRows) { error_Textblock.Text = "Email adres is reeds in gebruik."; txtbx_Email.Focus(); return; } ocmd.CommandText = String.Format("INSERT INTO PERSOON (NAAM, ACHTERNAAM, EMAIL, WACHTWOORD, TELEFOON, POSTCODE, NATIONALITEIT, WOONPLAATS, ADRES) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}') returning PERSOON_ID into :p1", txtbx_Naam.Text, txtbx_Achternaam.Text, txtbx_Email.Text, passwordBox1.Password, txtbx_Telefoon.Text, txtbx_Postcode.Text, txtbx_Nationaliteit.Text, txtbx_Woonplaats.Text, txtbx_Adres.Text); ocmd.ExecuteNonQuery(); OracleDecimal idDec = (OracleDecimal)ocmd.Parameters["p1"].Value; int persoonId = idDec.ToInt32(); oc.Close(); CommonMethods.loginUser = new Customer(persoonId, txtbx_Naam.Text, txtbx_Achternaam.Text, txtbx_Email.Text, passwordBox1.Password, txtbx_Telefoon.Text, txtbx_Postcode.Text, txtbx_Nationaliteit.Text, txtbx_Woonplaats.Text, txtbx_Adres.Text); NavigationWindow nw = new NavigationWindow(); nw.Navigate(new HomePage()); nw.ShowsNavigationUI = false; nw.Show(); CommonMethods.GetWindow(this).Close(); } else { error_Textblock.Text = "Alle velden dienen ingevuld te worden."; } }
public static void ShowNavigationWindows(NavigationWindow window, object pageAction, string title, BaseLayer baseLayer, ITaskLayer taskLayer) { _baseLayer = baseLayer; _taskLayer = taskLayer; window.Title = title; window.Width = 800; window.Height = 600; window.MinWidth = 450; window.MinHeight = 450; window.Content = pageAction; window.Closing += window_Closing; window.Show(); }
private void loadWebpage(string address, int windowHeight, int windowWidth) { GetSite gs = new GetSite(); gs.thisSite.Source = new Uri(address); NavigationWindow _navigationWindow = new NavigationWindow(); _navigationWindow.ResizeMode = ResizeMode.NoResize; _navigationWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; _navigationWindow.Width = windowWidth; _navigationWindow.Height = windowHeight; _navigationWindow.Show(); _navigationWindow.WindowStyle = WindowStyle.ToolWindow; _navigationWindow.Navigate(gs); }
public TestForm() { InitializeComponent(); nw = new NavigationWindow(); try { uri = new Uri("pack://application:,,,/NavigationDemo;component/Page1.xaml", UriKind.Absolute); nw.Navigate(uri); nw.Show(); } catch (Exception ex) {} }
private void btlogin_Click(object sender, RoutedEventArgs e) { lberror.Content = ""; ServiceStoreClient ssc = new ServiceStoreClient(); if (ssc.login(tbname.Text, tbpw.Password) != null) { ClientController.loginperson = ssc.login(tbname.Text, tbpw.Password); NavigationWindow nw = new NavigationWindow(); nw.ShowsNavigationUI = false; nw.Navigate(new StorePage()); nw.Show(); ClientController.GetWindow(this).Close(); } else { lberror.Content = "username or password are not valid"; } }
private void Button_ProductListDemo_Click(object sender, RoutedEventArgs e) { NavigationWindow window = new NavigationWindow(); window.Source = new Uri("ProductListPage.xaml", UriKind.Relative); window.Show(); }
protected void ShowNavigationWindow(Page contentPage) { NavigationWindow = new NavigationWindow { Title = WindowTitle, Content = contentPage, Width = 800, Height = 550, ShowsNavigationUI = false, }; NavigationWindow.Closing += NavigationWindow_Closing; NavigationWindow.Show(); }
/// <summary> /// Handles switch between fullscreen and regular mode. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event argument.</param> private void ExpandButton_Click(object sender, RoutedEventArgs e) { Window win = App.Current.MainWindow; VideoElement currentElement = (VideoElement)((VideoPage)((Frame)((Grid)win.Content).Children[0]).Content).player; if (!IsFullscreen) { currentElement.PausePlayback(); VideoPage page = new VideoPage(this.Source); page.player.Position = currentElement.Position; page.player.IsFullscreen = true; NavigationWindow window = new NavigationWindow { WindowStyle = WindowStyle.None, ShowsNavigationUI = false, WindowState = WindowState.Maximized, Topmost = true, Background = win.Background, Content = page, }; window.Show(); } else { currentElement.Position = this.Position; VideoPage page = (VideoPage)this.Parent; NavigationWindow window = (NavigationWindow)page.Parent; window.Close(); currentElement.PlayMedia(); } }
private void Application_Startup(object sender, StartupEventArgs e) { NavigationWindow win = new NavigationWindow(); win.Content = new MyPage(); win.Show(); }
static void label_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { try { Label label = sender as Label; DockPanel dp = label.Parent as DockPanel; Uri url = new Uri(dp.Tag.ToString()); NavigationWindow nw = new NavigationWindow(); nw.Source = url; nw.Show(); } catch (Exception) { } }