void NavigationSetup()
 {
     Messenger.Default.Register <NavigateArgs>(this, (x) =>
     {
         Frame1.Navigate(new Uri(x.Url, UriKind.Relative));
     });
 }
示例#2
0
        private void navigationview1_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            string alamleht = args.InvokedItem.ToString();

            if (alamleht != null)
            {
                switch (alamleht)
                {
                case "Pealeht":
                    Frame1.Navigate(typeof(Pealeht));
                    break;

                case "Tunniplaan":
                    Frame1.Navigate(typeof(Tunniplaan));
                    break;

                case "Kontakt":
                    Frame1.Navigate(typeof(kontakt));
                    break;


                case "Järelvastamine":
                    Frame1.Navigate(typeof(järelvastamine));
                    break;

                case "Bussiajad":
                    Frame1.Navigate(typeof(bussiajad));
                    break;
                }
            }
        }
示例#3
0
    public MainWindow()
    {
        InitializeComponent();
        Page1 page1 = new Page1(this);

        Frame1.Navigate(page1);
    }
示例#4
0
        public MainWindow()
        {
            InitializeComponent();
            InitializeList();
            MainPage mainPage = new MainPage(ref btnToMap, UpdateXml, ref sensors);

            Frame1.Navigate(mainPage);
        }
示例#5
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     //Generate a random puzzle at the start
     RandomPuzzle();
     //Load the home page
     homePage = new SolverHome();
     Frame1.Navigate(homePage);
 }
示例#6
0
        private void search_button_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = searchbox.Text.Length >= 3;

            if (isValid)
            {
                Frame1.Navigate(typeof(Pages.SearchResults), searchbox.Text);
            }
        }
示例#7
0
        public MainPage()
        {
            this.InitializeComponent();
            Frame1.Navigate((typeof(Home)));

            if (SikonSingleton == null)
            {
                Frame.Navigate(typeof(MainPage));
            }
        }
示例#8
0
 private void NavigationSetup()
 {
     Messenger.Default.Register <NavigateArgs>(this, (x) =>
     {
         if (!x.Url.Contains("Select"))
         {
             Frame1.Navigate(new Uri(x.Url, UriKind.Relative));
         }
     });
 }
示例#9
0
        public MainWindow()
        {
            InitializeComponent();

            Frame1.Navigate(new Menu(Frame1));

            /*DispatcherTimer DTimer = new DispatcherTimer();
             * DTimer.Interval = TimeSpan.FromMilliseconds(300);
             * DTimer.Tick += (s, args) => Timer_Tick();
             * DTimer.Start();*/
        }
示例#10
0
 private void UserPage_OnClick(object sender, RoutedEventArgs e)
 {
     if (SikonSingleton.LoggedAccount != null)
     {
         Frame1.Navigate(typeof(UserPage));
     }
     else
     {
         Frame1.Navigate(typeof(OpretBruger));
     }
 }
示例#11
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (!Frame1.CanGoBack)
     {
         Frame1.Navigate(new View.Pages.ReturnCassete(this));
     }
     else
     {
         System.GC.Collect();
         Frame1.Content = null;
         Frame1.RemoveBackEntry();
         Frame1.Navigate(new View.Pages.ReturnCassete(this));
     }
 }
示例#12
0
        private async void Login_OnClick(object sender, RoutedEventArgs e)
        {
            if (SikonSingleton.LoggedAccount == null)
            {
                Frame1.Navigate(typeof(Login));
            }
            else
            {
                SikonSingleton.LoggedAccount = null;

                Frame.Navigate(typeof(MainPage));
                ContentDialog dialog = new ContentDialog()
                {
                    Content = "Du er nu logget ud!", CloseButtonText = "Ok"
                };
                dialog.ShowAsync();
            }
        }
示例#13
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            //Better Geolocation Test
            if (locator == null)
            {
                locator = new Geolocator();
            }
            if (locator != null)
            {
                locator.MovementThreshold = 3;

                locator.PositionChanged +=
                    new TypedEventHandler <Geolocator,
                                           PositionChangedEventArgs>(locator_PositionChanged);
            }

            //StartGPS();
            ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;

            Debug.WriteLine("FLAG= " + localSettings.Values["FIRST_RUN_FLAG"].Equals("false"));

            if (localSettings.Values["FIRST_RUN_FLAG"].Equals("false"))
            {
                appBar.Visibility      = Visibility.Collapsed;
                searchpanel.Visibility = Visibility.Collapsed;
                Frame1.Navigate(typeof(Pages.FirstRun), this);
            }
            else
            {
                Frame1.Navigate(typeof(Pages.MainMenu), this);
            }

            Translate();

            // TODO: If your application contains multiple pages, ensure that you are
            // handling the hardware Back button by registering for the
            // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
            // If you are using the NavigationHelper provided by some templates,
            // this event is handled for you.
        }
示例#14
0
 private void Home_OnClick(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Home));
 }
示例#15
0
 private void Kort_OnClick(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Kort));
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = e.Parameter as MainPage;

            Frame1.Navigate(typeof(Page1), this);
        }
 private void Update_Click(object sender, RoutedEventArgs e)
 {
     Pages.UpdatePage updatePage = new Pages.UpdatePage();
     Frame1.Navigate(updatePage);
 }
示例#18
0
 private void AppBarButton_Click(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Pages.MainMenu), this);
 }
示例#19
0
 public void NavigateTo(object o)
 {
     Frame1.Navigate(o);
 }
示例#20
0
        public MainWindow()
        {
            if (App.CurrentApp.Browser == null)
            {
                App.CurrentApp.Browser = new OpenQA.Selenium.Chrome.ChromeDriver();
                App.CurrentApp.Browser.Manage().Window.Maximize();

                App.CurrentApp.Browser.Manage().Window.FullScreen();
            }



            InitializeComponent();


            FileStream   FS          = new FileStream("NameOfPrinter.txt", FileMode.OpenOrCreate);
            StreamReader Str         = new StreamReader(FS);
            string       PrinterName = Str.ReadLine();

            FS.Close();
            Str.Close();
            var server = new LocalPrintServer();

            server.Refresh();
            var queue       = server.GetPrintQueues();
            var neededQueue = queue.FirstOrDefault(f => f.Name == PrinterName?.Trim());

            if (neededQueue != null)
            {
                neededQueue?.Refresh();
                if (neededQueue?.NumberOfJobs != 0)
                {
                    var g = neededQueue?.GetPrintJobInfoCollection();
                    foreach (var ku in g)
                    {
                        ku.Cancel();
                    }


                    //neededQueue.Purge();
                }
            }

            Frame1.NavigationService.Navigate(new Chose_Page(), UriKind.Relative);
            var myID = Process.GetCurrentProcess();

            Widthh  = SystemParameters.PrimaryScreenWidth;
            Heightt = SystemParameters.PrimaryScreenHeight;
            //this.Cursor = Cursors.None;
            Process process = Process.Start(new ProcessStartInfo
            {
                FileName        = "taskkill",
                Arguments       = "/F /IM explorer.exe",
                CreateNoWindow  = true,
                UseShellExecute = false,
                WindowStyle     = ProcessWindowStyle.Hidden
            });

            process?.WaitForExit();
            Closing += (e, a) =>
            {
                Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));
            };
            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(3);
            timer.Tick    += (sender, args) =>
            {
                if (UserInactivity.GetSeconds() >= 90)
                {
                    if (App.CurrentApp.Kw != null)
                    {
                        try
                        {
                            App.CurrentApp.Kw.Topmost = false;
                            App.CurrentApp.Kw.Close();
                        }
                        catch (Exception e)
                        {
                        }
                    }

                    if (!(Frame1.Content is Chose_Page))
                    {
                        Frame1.Navigate(new Chose_Page());

                        App.CurrentApp.Browser.Manage().Window.Minimize();
                    }
                }
            };
            timer.Start();
        }
示例#21
0
 private void Settings_Button_Click(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Pages.Definicoes), this);
 }
示例#22
0
 private void Info_OnClick(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Info));
 }
示例#23
0
 private void load_items()
 {
     Frame1.Navigate(typeof(Pealeht));
 }
 private void List_Click(object sender, RoutedEventArgs e)
 {
     Pages.ViewPage viewPage = new Pages.ViewPage();
     Frame1.Navigate(viewPage);
 }
示例#25
0
 public ClientWindow()
 {
     InitializeComponent();
     DataContext = new ViewModel.ClientWindowViewModel();
     Frame1.Navigate(new View.Pages.CassetesList(this));
 }
示例#26
0
 private void Kurser_Click(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Kurser));
 }
示例#27
0
 private void Btn_Page3_Click(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(Page3));
 }
示例#28
0
 private void Program_Click(object sender, RoutedEventArgs e)
 {
     Frame1.Navigate(typeof(ProgramView));
 }
示例#29
0
 public MainPage()
 {
     this.InitializeComponent();
     Frame1.Navigate(typeof(MasterPage));
 }
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     Pages.DeletePage deletePage = new Pages.DeletePage();
     Frame1.Navigate(deletePage);
 }