Ejemplo n.º 1
0
 private void btnSettings_Click(object sender, RoutedEventArgs e)
 {
     selectNav(sender as Button);
     if (settingsPage == null)
     {
         settingsPage = new page.pageSettings();
     }
     showPage(settingsPage);
 }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            System.Threading.Thread thread = new System.Threading.Thread(() =>
            {
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
                {
                    homePage     = new page.pageHome();
                    loginPage    = new page.pageLogin();
                    reportPage   = new page.pageReport();
                    settingsPage = new page.pageSettings();

                    btnHome_Click(btnHome, new RoutedEventArgs());
                }));
            });
            thread.SetApartmentState(System.Threading.ApartmentState.STA);
            thread.Start();


            threadLastReport = new System.Threading.Thread(() =>
            {
                try
                {
                    while (true)
                    {
                        classes.Job.Database.rpLast = null;
                        classes.Job.Database.getLastReport();
                        Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => {
                            gvSticker.DataContext = classes.Job.Database.getLastReport();
                        }));
                        System.Threading.Thread.Sleep(2500);

                        try
                        {
                        }
                        catch (System.Threading.ThreadAbortException abortException) { throw abortException; }
                        catch (Exception ex) { Console.WriteLine("gSliderError#2:" + ex); }
                    }
                }
                catch (Exception ex) { Console.WriteLine("gSliderError#1:" + ex); }
            });

            threadLastReport.Start();

            startMarquee(canvas1, marquee1, 20);
            startMarquee(canvas2, marquee2, 20);
            startMarquee(canvas3, marquee3, 20);
            startMarquee(canvas4, marquee4, 20);
        }