/*
  * События страницы
  */
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (!poiselectionViewModel.IsDataLoaded)
     {
         DataContext = LoadPoiSelectionData();
     }
 }
 private void Browser_Navigated(object sender, NavigationEventArgs e)
 {
     if (e.NavigationMode == NavigationMode.New)
       {
     _browserHistoryLength++;
       }
 }
 // Executes when the user navigates to this page.
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     //if (!WebContext.Current.User.IsInRole("DzialZaopatrzenia"))
     //{
     //    this.NavigationService.Navigate(new Uri("/NoAcces", UriKind.Relative));
     //}
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            RefreshListaMoedas();
            RefreshPieChart();

            chart1.DataSource = null;

            if(PC1.DataSource != null)
                PC1.DataSource = null;
            #region rascunho
            //PC1.DataSource = nulado;

            //try
            //{
            //    PC1.DataSource = s;

            //}
            //catch
            //{
            //    PC1.DataSource = EmPizza;
            //}

            #endregion
            PC1.DataSource = EmPizza;
            chart1.DataSource = MoedasDoJson;
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     photosList.ItemsSource = Photos;
     scrollStateListBox.ItemsSource = Photos;
     LoadDataFromSource();
 }
Пример #6
0
        protected override void OnNavigatedTo(
            bool cancelled, NavigationEventArgs e)
        {
            if (cancelled)
                return;

            _database = Cache.Database;
            if (_database == null)
            {
                this.BackToDBs();
                return;
            }

            string id;
            var queries = NavigationContext.QueryString;

            if (queries.TryGetValue("entry", out id))
                _entry = _database.GetEntry(id);
            else
            {
                id = queries["group"];
                _group = _database.GetGroup(id);
            }

            _target = _database.Root;
            Refresh();
        }
Пример #7
0
        protected override void OnNavigatedTo(
            bool cancelled, NavigationEventArgs e)
        {
            _moved = false;

            if (cancelled)
            {
                _moved = true;
                return;
            }

            SourceCapabilityUpdater.Update();

            if (AppSettings.Instance.AllowAnalytics == null)
            {
                _moved = true;
                this.NavigateTo<AnalyticsSettings>();
                return;
            }

            Cache.Clear();

            var checkTileOpen = e.NavigationMode !=
                NavigationMode.Back;
            RefreshDbList(checkTileOpen);
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New)
     {
         var selectedItem = new BaseItemDto();
         if(App.SelectedItem == null)
         {
             string name, id;
             if (NavigationContext.QueryString.TryGetValue("name", out name) &&
                 NavigationContext.QueryString.TryGetValue("id", out id))
             {
                 selectedItem = new BaseItemDto
                                    {
                                        Name = name,
                                        Id = id,
                                        Type = "FolderCollection"
                                    };
             }
         }
         if (App.SelectedItem is BaseItemDto)
         {
             selectedItem = (BaseItemDto) App.SelectedItem;
         }
         DataContext = new FolderViewModel(ViewModelLocator.NavigationService, ViewModelLocator.ConnectionManager)
         {
             SelectedFolder = selectedItem
         };
     }
 }
Пример #9
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     App currentApp = (App)Application.Current;
     this.cityBox.Text = currentApp.Travel.Car.getFuelConsumptionForRouteType(Libs.ChangeRouteTypeTravelEvent.RouteTypes.citi).ToString();
     this.mixedBox.Text = currentApp.Travel.Car.getFuelConsumptionForRouteType(Libs.ChangeRouteTypeTravelEvent.RouteTypes.mixed).ToString();
     this.hwBox.Text = currentApp.Travel.Car.getFuelConsumptionForRouteType(Libs.ChangeRouteTypeTravelEvent.RouteTypes.hw).ToString();
 }
Пример #10
0
 private void WebBrowser1_LoadCompleted(object sender, NavigationEventArgs e)
 {
     if (e.Uri.ToString().IndexOf("access_token", StringComparison.Ordinal) != -1)
     {
         string accessToken = String.Empty;
         int userId = 0;
         var regex = new Regex(@"(?<name>[\w\d\x5f]+)=(?<value>[^\x26\s]+)", RegexOptions.IgnoreCase | RegexOptions.Singleline);
         foreach (Match match in regex.Matches(e.Uri.ToString()))
         {
             if (match.Groups["name"].Value == "access_token")
             {
                 accessToken = match.Groups["value"].Value;
             }
             else if (match.Groups["name"].Value == "user_id")
             {
                 userId = Convert.ToInt32(match.Groups["value"].Value);
             }
         }
         _token = new Token {AccessToken = accessToken, UserId = userId};
         var groupWindow = new GroupWindow();
         groupWindow.AccessToken.Content = _token.AccessToken;
         groupWindow.UserID.Content = _token.UserId;
         groupWindow.Show();
         this.Close();
     }
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            plan = GetSeletcedPlan();

            bookService = BookService.getInstance();

            List<string> pl = new List<string>() { "高", "中", "低" };
            this.prioritylist.ItemsSource = pl;

            this.prioritylist.SelectedItem = plan.Priority;

            this.bookname.Text = plan.Title;
            //this.bookname.IsEnabled = false;
            this.bookname.IsReadOnly = true;
            this.bookname.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));

            if (flag)
            {
                this.datePicker.Value = DateTime.Parse(plan.DatePicker);
                this.timepicker.Value = DateTime.Parse(plan.RingTime);
                flag = false;
            }

            this.detail.Text = plan.Detail;

            this.toggle.IsChecked = plan.IsReminder;

            isRemind = plan.IsReminder;
        }
Пример #12
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     List<BothHands> history = App.settings["handhistory"] as List<BothHands>;
     StatsList.ItemsSource = (from p in history
                             orderby p.TimeStamp descending
                             select p).Take(40);
 }
Пример #13
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     var contextIndex = int.Parse(NavigationContext.QueryString["context"]);
     var repoName = NavigationContext.TryGetStringKey("repo");
     ViewModel.ContextIndex = contextIndex;
     ViewModel.RepoName = repoName;
 }
Пример #14
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     if (e.Content is Settings)
         (e.Content as Settings).PasswordsUpdated += PasswordPage_PasswordsUpdated;
     base.OnNavigatedFrom(e);
     
 }
Пример #15
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            MoveAnimation.MoveTo(imageL, Width / 2 - imageL.Width, 0, TimeSpan.FromSeconds(1), null);
            MoveAnimation.MoveTo(imageR, -Width / 2 + imageR.Width, 0, TimeSpan.FromSeconds(1), null);

            base.OnNavigatedTo(e);
        }
 // Sample code for building a localized ApplicationBar
 //private void BuildLocalizedApplicationBar()
 //{
 //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
 //    ApplicationBar = new ApplicationBar();
 //    // Create a new button and set the text value to the localized string from AppResources.
 //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
 //    appBarButton.Text = AppResources.AppBarButtonText;
 //    ApplicationBar.Buttons.Add(appBarButton);
 //    // Create a new menu item with the localized string from AppResources.
 //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
 //    ApplicationBar.MenuItems.Add(appBarMenuItem);
 //}
 /// <summary>
 /// Called when this page is navigated to.
 /// Starts the recognition process.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     // call default behaviour
     base.OnNavigatedTo(e);
     // initialize the recognition process
     mRecognizer.InitializeControl(this.Orientation);
 }
Пример #17
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            this.name = this.NavigationContext.QueryString["name"];
            this.id = this.NavigationContext.QueryString["id"];
        }
Пример #18
0
		// Load data for the ViewModel Items
		protected override async void OnNavigatedTo(NavigationEventArgs e)
		{
			if (!ViewModel.IsSignedIn)
			{
				await ViewModel.TryLoginAsync();
			}

			if (ContentPanorama.SelectedItem == RecentReadingItem && !ViewModel.IsRecentDataLoaded)
			{
				await ViewModel.UpdateRecentViewAsync();
			}
			else if (ContentPanorama.SelectedItem == SeriesIndexItem && !ViewModel.IsIndexDataLoaded)
			{
				await ViewModel.LoadSeriesIndexDataAsync();
			}
			else if (ContentPanorama.SelectedItem == RecommandItem && !ViewModel.IsRecommandLoaded)
			{
				await ViewModel.LoadRecommandDataAsync();
			}
			else if (ContentPanorama.SelectedItem == FavoriteSection && !ViewModel.IsFavoriteLoaded)
			{
				await ViewModel.LoadUserFavouriateAsync();
			}
			//else if (ContentPanorama.SelectedItem == UserRecentSection && !ViewModel.IsUserRecentLoaded)
			//{
			//	await ViewModel.LoadUserRecentAsync();
			//}
		}
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     Browser.LoadCompleted -= Browser_LoadCompleted;
     Browser.Navigating -= Browser_Navigating;
     Browser.NavigationFailed -= Browser_NavigationFailed;
     base.OnNavigatedFrom(e);
 }
Пример #20
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     string localvalue;
     if(NavigationContext.QueryString.TryGetValue("parameter",out localvalue))
         name_of_the_person = localvalue;
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode == NavigationMode.New)
            {
                XElement article = XElement.Load("Resources/about_program.xml");

                XElement Credits = article.Element("Credits");
                CreditsAbout.Text = Credits.Element("text").Value;

                CreditsCopyright.Text = "\u00A9" + CreditsCopyright.Text;
                CreditsText.Content = "\"" + CreditsText.Content + "\"";

                Version.Text = AppResources.Version + ": " + article.Element("version").Value;

                XElement developer = article.Element("developer");
                Stream stream = Application.GetResourceStream(new Uri(developer.Element("logo").Attribute("src").Value, UriKind.Relative)).Stream;

                BitmapImage bmp = new BitmapImage();
                bmp.SetSource(stream);
                stream.Close();

                DeveloperLogo.Source = bmp;
                DeveloperLogo.Stretch = Stretch.Uniform;
            }
        }
Пример #22
0
    protected override async void OnNavigatedTo(NavigationEventArgs e) {

      StreamResourceInfo sri = Application.GetResourceStream(new Uri("DemoImage.jpg", UriKind.Relative));
      var myBitmap = new WriteableBitmap(800, 480);
      img.ImageSource = myBitmap;

      using (var editsession = await EditingSessionFactory.CreateEditingSessionAsync(sri.Stream)) {
        // First add an antique effect 
       editsession.AddFilter(FilterFactory.CreateCartoonFilter(true));


       editsession.AddFilter(FilterFactory.CreateAntiqueFilter());
       // Then rotate the image
       editsession.AddFilter(FilterFactory.CreateFreeRotationFilter(35.0f, RotationResizeMode.FitInside));


        await editsession.RenderToBitmapAsync(myBitmap.AsBitmap());

   
      }
     
      myBitmap.Invalidate();

      base.OnNavigatedTo(e);
    }
Пример #23
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     CallbackManager.currentPage = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Пример #24
0
 // Load data for the ViewModel Items
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (!App.ViewModel.IsDataLoaded)
     {
         App.ViewModel.LoadData();
     }
 }
Пример #25
0
        protected override void OnNavigatedTo(
            bool cancelled, NavigationEventArgs e)
        {
            if (cancelled)
                return;

            var database = Cache.Database;

            DateTime convertedDate;
            if ((Cache.DbInfo != null) && (Cache.DbInfo.Details.Modified != null))
            {
                convertedDate = DateTime.Parse(Cache.DbInfo.Details.Modified);
                ApplicationTitle.Text = "8Pass - " + Cache.DbInfo.Details.Name + " (" + convertedDate + ")";
            }

            if (database == null)
            {
                this.BackToDBs();
                return;
            }

            if (Cache.DbInfo.Details.Type.ToString() == "OneTime")
                mnuSync.IsEnabled = false;

            _group = GetGroup(database);
            lstHistory.ItemsSource = null;
            pivotGroup.Header = _group.Name;

            ThreadPool.QueueUserWorkItem(_ =>
                ListItems(_group, database.RecycleBin));

            ThreadPool.QueueUserWorkItem(_ =>
                ListHistory(database));
        }
Пример #26
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (ApiHelper.UserIsLoggedIn())
     {
         NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
     }
 }
Пример #27
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            //string id = "";
            string id = string.Empty;
            if (NavigationContext.QueryString.TryGetValue("id", out id))
            {
                System.Diagnostics.Debug.WriteLine("ID de la pieza: " + id);
            }

            HttpClient client = new HttpClient();
            string json = await client.GetStringAsync(new Uri("http://museosapp.azurewebsites.net/Piezas/"+id));
            _piezas = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Piezas>>(json);

            //Piezas piezas = NavigateServiceExtends.GetNavigationData(NavigationService) as Piezas;



            //System.Diagnostics.Debug.WriteLine("PIEZAAAAAAA: " + piezas.descripcion);
            //piezas.descripcion;
            //Ésta línea trae toda la información del museo que se ha seleccionado en otro xaml.
            // Y la muestra en el xaml actual.


            //this.DataContext = piezas;

            ElementosQR.ItemsSource = _piezas;
            loadPieza.Visibility = Visibility.Collapsed;
            txtCargando.Visibility = Visibility.Collapsed;
        }
Пример #28
0
 // Executes when the user navigates to this page.
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (!WebContext.Current.User.IsInRole("Administrator"))
     {
         this.NavigationService.Navigate(new Uri("/NoAcces", UriKind.Relative));
     }
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (!App.Instance.IsAuthorized)
                NavigationService.Navigate(new Uri("/View/Login.xaml", UriKind.Relative));
        }
Пример #30
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (NavigationContext.QueryString.ContainsKey("BooksellerID"))
     {
         currentbookseller = App.AllViewModels.booksellerretrieveindatabase(int.Parse(NavigationContext.QueryString["BooksellerID"]));
         newbooksellerfullnametext.Text  = currentbookseller.Bookseller;
         newbooksellerhomepagetext.Text  = currentbookseller.Homepage;
         newbookselleremailtext.Text     = currentbookseller.Email;
         newbookselleraddresstext.Text   = currentbookseller.Address;
         newBookselleremailnewstext.Text = currentbookseller.Email_news;
         newBookselleraddinfotext.Text   = currentbookseller.Additioninfo;
         newBooksellerphonetext.Text     = currentbookseller.Phone;
         newBooksellermailnewstext.Text  = currentbookseller.Mail_news;
         App.AllViewModels.Allresults_by_bookBookseller(currentbookseller.Bookseller);
     }
 }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (NavigationContext.QueryString.TryGetValue("pseudo", out pseudo))
            {
                pseudoText.Text = pseudo;
                foreach (Result r1 in user.friends)
                {
                    if (r1.pseudo == pseudo)
                    {
                        r = r1;
                    }
                }
                Init();
            }
        }
Пример #32
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (Data.Connection == null)
            {
                MessageBox.Show("Giriş yapmanız gerekiyor!");
                NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
            }
            else
            {
                if (NavigationContext.QueryString.ContainsKey("YearCode") && NavigationContext.QueryString.ContainsKey("No"))
                {
                    YearCode = Convert.ToInt32(NavigationContext.QueryString["YearCode"]);
                    No       = Convert.ToInt32(NavigationContext.QueryString["No"]);
                    Donem period = Data.Connection.Ogrenci.Donemler.SingleOrDefault(x => x.No == No && x.OgretimYiliKodu == YearCode);
                    Title.Text             = period.OgretimYili + " " + period.Adi;
                    LessonList.ItemsSource = period.Dersler;
                }
                else
                {
                    Donem period = Data.Connection.Ogrenci.Donemler.First();
                    YearCode = period.OgretimYiliKodu;
                    No       = period.No;
                    LessonList.ItemsSource = period.Dersler;

                    if (NetworkInterface.GetIsNetworkAvailable())
                    {
                        ProgressIndicator indicator = new ProgressIndicator();
                        indicator.IsIndeterminate = true;
                        indicator.IsVisible       = true;
                        try
                        {
                            indicator.Text = "Dersler güncelleniyor..";
                            Service1Client client = new Service1Client();
                            client.CurrentPeriodAsync(Data.Connection.OgrenciNo, Data.Connection.Sifre, "WP8");
                            client.CurrentPeriodCompleted += new EventHandler <CurrentPeriodCompletedEventArgs>(Completed);
                        }
                        catch (Exception)
                        {
                            indicator.Text = "Dersler yüklenemedi!";
                        }
                        SystemTray.SetProgressIndicator(this, indicator);
                    }
                }
            }
        }
Пример #33
0
        private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
        {
            // Unregister the event so it doesn't get called again
            RootFrame.Navigated -= ClearBackStackAfterReset;

            // Only clear the stack for 'new' (forward) and 'refresh' navigations
            if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh)
            {
                return;
            }

            // For UI consistency, clear the entire page stack
            while (RootFrame.RemoveBackEntry() != null)
            {
                ; // do nothing
            }
        }
Пример #34
0
 private void Browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
 {
     try {
         foreach (IHTMLElement archor in ((IHTMLDocument2)browser.Document).links)
         {
             archor.setAttribute("target", "_self");
         }
         foreach (IHTMLElement form in ((IHTMLDocument2)browser.Document).forms)
         {
             form.setAttribute("target", "_self");
         }
         if ((browser.Document as HTMLDocument).readyState == "complete" && OnComplete != null)
         {
             OnComplete(URL);
         }
     } catch { }
 }
Пример #35
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            AppSettings settings = new AppSettings();

            if (settings.MobilizerSetting)
            {
                link = new Uri(MOBILIZIER + this.NavigationContext.QueryString["link"]);
            }
            else
            {
                link = new Uri(this.NavigationContext.QueryString["link"]);
            }

            this.WebBrowser1.Loaded += webBrowser_Loaded;
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (appArgs.Waiting)
            {
                RscPageArgsRet appOutput = appArgs.GetOutput();
                if (appOutput != null)
                {
                    txOut.Text = appOutput.ID + " | " + appOutput.GetFlag(0);
                }

                appArgs.Clear();
            }
            else
            {
                txOut.Text = "OnNavigatedTo...";
            }
        }
        //Code for initialization, capture completed, image availability events; also setting the source for the viewfinder.
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Check to see if the camera is available on the phone.
            if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true) ||
                (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing) == true))
            {
                // Initialize the camera, when available.
                if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing))
                {
                    // Use front-facing camera if available.
                    cam = new Microsoft.Devices.PhotoCamera(CameraType.FrontFacing);
                }
                else
                {
                    // Otherwise, use standard camera on back of phone.
                    cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
                }

                // Event is fired when the PhotoCamera object has been initialized.
                cam.Initialized += new EventHandler <Microsoft.Devices.CameraOperationCompletedEventArgs>(cam_Initialized);

                // Event is fired when the capture sequence is complete.
                cam.CaptureCompleted += new EventHandler <CameraOperationCompletedEventArgs>(cam_CaptureCompleted);

                // Event is fired when the capture sequence is complete and an image is available.
                cam.CaptureImageAvailable += new EventHandler <Microsoft.Devices.ContentReadyEventArgs>(cam_CaptureImageAvailable);

                // Event is fired when the capture sequence is complete and a thumbnail image is available.
                cam.CaptureThumbnailAvailable += new EventHandler <ContentReadyEventArgs>(cam_CaptureThumbnailAvailable);

                //Set the VideoBrush source to the camera.
                viewfinderBrush.SetSource(cam);
            }
            else
            {
                // The camera is not supported on the phone.
                this.Dispatcher.BeginInvoke(delegate()
                {
                    // Write message.
                    txtDebug.Text = "A Camera is not available on this phone.";
                });

                // Disable UI.
                ShutterButton.IsEnabled = false;
            }
        }
Пример #38
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);


            string msg = "";

            if (NavigationContext.QueryString.TryGetValue("kysymys", out msg))
            {
                kysymys            = kyssarit[int.Parse(msg) - 1];
                txtQuestion.Text   = "Kysymys numero " + kysymys.KysymysNro + ": " + kysymys.KysymysTxt;
                answer1Btn.Content = kysymys.VastausVaihtoehdot[0];
                answer2Btn.Content = kysymys.VastausVaihtoehdot[1];
                answer3Btn.Content = kysymys.VastausVaihtoehdot[2];
                answer4Btn.Content = kysymys.VastausVaihtoehdot[3];
            }
        }
Пример #39
0
        private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
        {
            // Désinscrire l'événement pour qu'il ne soit plus appelé
            RootFrame.Navigated -= ClearBackStackAfterReset;

            // Effacer uniquement la pile des « nouvelles » navigations (avant) et des actualisations
            if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh)
            {
                return;
            }

            // Pour une interface utilisateur cohérente, effacez toute la pile de la page
            while (RootFrame.RemoveBackEntry() != null)
            {
                ; // ne rien faire
            }
        }
Пример #40
0
        /// <summary>
        /// OnNavigatedTo event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            LayoutRoot.IsHitTestVisible = true;
            yourDetailsUpdateVM         = new StateHelper().RestorePageLevelData <YourDetailsUpdateViewModel>(_yourDetailsUpdateVMKey);
            if ((App.IsToombStoned) || (!string.IsNullOrEmpty(App.SurgeonSaved)))
            {
                if (yourDetailsUpdateVM != null)
                {
                    yourDetailsUpdateVM.PrimaryColour = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.primary_colour);

                    yourDetailsUpdateVM.SecondaryColour = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.secondary_colour);

                    yourDetailsUpdateVM.FontColor           = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.font_colour);
                    yourDetailsUpdateVM.ButtonValueOnupdate = App.SurgeonSaved;
                }
                else
                {
                    yourDetailsUpdateVM = new YourDetailsUpdateViewModel(App.ObjLgResponse);
                }
            }
            else
            {
                if (yourDetailsUpdateVM == null)
                {
                    yourDetailsUpdateVM = new YourDetailsUpdateViewModel(App.ObjLgResponse);
                }
                else if (string.IsNullOrEmpty(App.SurgeonSaved) || string.IsNullOrWhiteSpace(App.SurgeonSaved))
                {
                    yourDetailsUpdateVM.ButtonValueOnupdate = "Choose Doctor for surgery (Optional)";
                }
            }

            this.DataContext = yourDetailsUpdateVM;

            new StateHelper().ClearPageLevelData <YourDetailsUpdateViewModel>(_yourDetailsUpdateVMKey, yourDetailsUpdateVM);

            base.OnNavigatedTo(e);
            App.TombStonedPageURL = PageURL.navigateToYourDetailsUpdateURL;

            if (!e.IsNavigationInitiator)
            {
                App.IsToombStoned = false;
                NavigationService.Navigate(new Uri(PageURL.navigateToEnterPinURL, UriKind.RelativeOrAbsolute));
            }
        }
Пример #41
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back)
            {
                return;
            }

            SystemTray.IsVisible = true;
            _phoneHeight         = Application.Current.Host.Content.ActualHeight;
            _phoneWidth          = Application.Current.Host.Content.ActualWidth;

            if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true) ||
                (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing) == true))
            {
                if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing))
                {
                    cam = new PhotoCamera(CameraType.FrontFacing);
                }
                else
                {
                    cam = new PhotoCamera(CameraType.Primary);
                }

                _cameraHeight = cam.AvailableResolutions.FirstOrDefault().Height;
                _cameraWidth  = cam.AvailableResolutions.FirstOrDefault().Width;

                cam.CaptureCompleted      += new EventHandler <CameraOperationCompletedEventArgs>(cam_CaptureCompleted);
                cam.CaptureImageAvailable += new EventHandler <ContentReadyEventArgs>(cam_CaptureImageAvailable);
                viewfinderBrush.SetSource(cam);
                OnOrientationChanged(new OrientationChangedEventArgs(Orientation));

                bmi = new BitmapImage(new Uri("/Images/Levels/L2.JPG", UriKind.Relative));
                this.grimacePattern.Source = bmi;

                startDate = DateTime.Now;

                timer.Tick    += new EventHandler(timer_Tick);
                timer.Interval = new TimeSpan(0, 0, 1);
                timer.Start();
            }
            else
            {
                Message = "A Camera is not available on this phone.";
            }
        }
Пример #42
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (this.NavigationContext.QueryString.TryGetValue("blog_id", out blog_id) &&
                this.NavigationContext.QueryString.TryGetValue("comment_id", out comment_id))
            {
                List <Blog> blogs = DataService.Current.Blogs.ToList();
                foreach (Blog currentBlog in blogs)
                {
                    if (currentBlog.isWPcom() || currentBlog.hasJetpack())
                    {
                        string currentBlogID = currentBlog.isWPcom() ? Convert.ToString(currentBlog.BlogId) : currentBlog.getJetpackClientID();
                        if (currentBlogID == blog_id)
                        {
                            BlogName.Text = currentBlog.BlogName;
                            _currentBlog  = currentBlog;
                        }
                    }
                }
            }

            if (_currentBlog == null)
            {
                if (NavigationService.CanGoBack)
                {
                    NavigationService.GoBack();
                }
                return;
            }

            GetAllCommentsRPC rpc = new GetAllCommentsRPC(_currentBlog);

            rpc.Number     = 20;
            rpc.Offset     = 0;
            rpc.Completed += OnFetchCurrentBlogCommentsCompleted;

            rpc.ExecuteAsync();

            UIThread.Invoke(() =>
            {
                ApplicationBar.IsVisible = false;
                App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.Loading);
            });
        }
Пример #43
0
        private async void fbLoginBrowser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            string accessToken = ConfigurationManager.AppSettings.Get("FacebookAccessToken");

            if (string.IsNullOrEmpty(accessToken))
            {
                accessToken = fbapi.GetFacebookLoginResponse(e.Uri);
            }

            if (!string.IsNullOrEmpty(accessToken))
            {
                ConfigurationManager.AppSettings.Set("FacebookAccessToken", accessToken);

                var result = await fbapi.GetLogedUserInfoAsync(accessToken);

                Credentials.UserCredentials.Current.FullName = result["name"].ToString();

                _myEventsClient.AuthenticationService.LogOnAsync(accessToken, (UserResult) =>
                {
                    if (UserResult != null)
                    {
                        Credentials.UserCredentials.Current.UserId        = UserResult.RegisteredUserId;
                        Credentials.UserCredentials.Current.FacebookToken = accessToken;
                        Credentials.UserCredentials.Current.MyEventsToken = UserResult.Token;
                        Credentials.UserCredentials.Current.FacebookId    = UserResult.FacebookUserId;

                        _myEventsClient.SetAccessToken(Credentials.UserCredentials.Current.MyEventsToken);
                        Dispatcher.Invoke(() =>
                        {
                            progressBarLogin.Visibility = System.Windows.Visibility.Collapsed;
                            (this.DataContext as MainPageViewModel).ShowFacebookLogin = false;
                        });
                    }
                    else
                    {
                        Dispatcher.Invoke(() =>
                        {
                            fbapi.LogOut();
                            ConfigurationManager.AppSettings.Set("FacebookAccessToken", string.Empty);
                            FacebookLogin_IsVisibleChanged(this, new DependencyPropertyChangedEventArgs(VisibilityProperty, true, true));
                        });
                    }
                });
            }
        }
Пример #44
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            Container.Resolve <IMessagePublisher>().Register(this);
            ExNavigationService.ClearNavigationHistory();

            if (NavigationEventArgs.IsBackOrReset())
            {
                NotifyOfPropertyChange(() => Workspaces);
                NotifyOfPropertyChange(() => DueTodayTasks);
                NotifyOfPropertyChange(() => MyTasks);
                NotifyOfPropertyChange(() => Users);
                NotifyOfPropertyChange(() => DueTomorrowTasks);
                NotifyOfPropertyChange(() => DueWeekendTasks);
            }


            RatingNotificationService.Run(new ApplicationSettingsService(), "Rate our application, we'd like to know what you think about Winsana!", 1, 7, "Winsana", "ok", "cancel");
        }
Пример #45
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            DataSaver <Baglanti> dataSaver = new DataSaver <Baglanti>();

            Data.Connection = dataSaver.LoadMyData("Connection");

            DataSaver <string> _dataSaver = new DataSaver <string>();
            string             id         = _dataSaver.LoadMyData("StudentID");
            string             pass       = _dataSaver.LoadMyData("Password");

            if (id != null && pass != null)
            {
                txtStudentID.Text    = _dataSaver.LoadMyData("StudentID");
                txtPassword.Password = _dataSaver.LoadMyData("Password");
            }
        }
Пример #46
0
        /// <summary>
        /// OnNavigatedTo event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            App.TombStonedPageURL = PageURL.navigateToLeafletURL;

            if (!e.IsNavigationInitiator)
            {
                App.IsToombStoned = false;
                NavigationService.Navigate(new Uri(PageURL.navigateToEnterPinURL, UriKind.RelativeOrAbsolute));
            }


            if (NavigationContext.QueryString.TryGetValue("source", out source))
            {
                source = "pharmacy";
            }
        }
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     bool_QC = true;
     if (App.Item_Current.ImageSource == string.Empty || App.Item_Current.ImageSource == null)
     {
         try
         {
             Image_Source = LockScreen.GetImageUri().LocalPath;
             Name         = App.Item_Current.Name;
         }
         catch { }
     }
     else
     {
         Image_Source = App.Item_Current.ImageSource;
     }
 }
Пример #48
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (Data.Connection == null)
     {
         MessageBox.Show("Giriş yapmanız gerekiyor!");
         NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
     }
     else
     {
         Ogrenci student = Data.Connection.Ogrenci;
         StudentName.Text = student.AdSoyad;
         Faculty.Text     = student.Fakulte;
         Department.Text  = student.Bolum;
         Class.Text       = student.Sinif.ToString();
         GANO.Text        = student.GANO.ToString();
     }
 }
Пример #49
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
     {
         Utils.CommonUtils.UpdateTile();
         _navigateMode =
             NavigationContext.QueryString.ContainsKey(KEYSTRING) ?
             PPTVNavigateMode.HubVideo : _navigateMode;
         _navigateMode =
             NavigationContext.QueryString.ContainsKey("pursuittoast") ?
             PPTVNavigateMode.ToastNotify : _navigateMode;
     }
     else
     {
         _navigateMode = PPTVNavigateMode.MainPage;
     }
     Navigate();
 }
Пример #50
0
        //Executes when the user navigates to this page.
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (!M.isLoggedIn)
            {
                MessageBox.Show("You cannot use this function until you are Logged In.");
                this.NavigationService.Navigate(new System.Uri("/Home", UriKind.Relative));
                return;
            }
            mailClient = new SQLReference.Service1ConsoleClient();
            mailClient.getAllUsersCompleted += client_getUsersCompleted;
            mailClient.getAllUsersAsync();

            M.CenterCanvas(LayoutRoot, this);
            M.ScreenResized += delegate
            {
                M.CenterCanvas(LayoutRoot, this);
            };
        }
Пример #51
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Initialize the camera object
            _phoneCamera              = new PhotoCamera();
            _phoneCamera.Initialized += Camera_Initialized;

            //Display the camera feed in the UI
            viewfinderBrush.SetSource(_phoneCamera);

            // This timer will be used to scan the camera buffer every 250ms and scan for any barcodes
            _scanTimer          = new DispatcherTimer();
            _scanTimer.Interval = TimeSpan.FromMilliseconds(250);
            _scanTimer.Tick    += (o, arg) => ScanForBarcode();

            CameraButtons.ShutterKeyHalfPressed += CameraButtons_ShutterKeyHalfPressed;

            base.OnNavigatedTo(e);
        }
        private void Browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            //stop progress indicator
            SetProgressIndicator(false);

            //Fill the tracklist just once in the first load.
            if (isFirstLoad & ((TransitionFrame)System.Windows.Application.Current.RootVisual).Content == this)
            {
                FillTrackList(Tracks);
                ListPickerInstrument.SelectionChanged += ListPickerInstrument_SelectionChanged;
                ListPickerInstrument.Visibility        = Visibility.Visible;
                slider.MouseLeftButtonUp += Slider_Clicked;
                isFirstLoad = false;

                var viewModel = DataContext as StaveTabViewModel;
                viewModel.Browser_LoadCompleted(sender, e);
            }
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            _vm = (RitInfoViewModel)DataContext;
            _vm.RitInfoAvailable += _vm_RitInfoAvailable;

            if (this.NavigationContext.QueryString.ContainsKey("id"))
            {
                string station     = this.NavigationContext.QueryString["id"];
                string company     = this.NavigationContext.QueryString["company"];
                string trein       = this.NavigationContext.QueryString["trein"];
                string richting    = this.NavigationContext.QueryString["richting"];
                string stationCode = this.NavigationContext.QueryString["stationCode"];

                _vm.Initialize(station, company, trein, richting, stationCode);
            }
        }
Пример #54
0
 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     fileNameToEdit = NavigationContext.QueryString["file"];
     System.Diagnostics.Debug.WriteLine(fileNameToEdit);
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
     {
         using (IsolatedStorageFileStream isfs =
                    isf.OpenFile(fileNameToEdit, FileMode.OpenOrCreate))
         {
             using (StreamReader sr = new StreamReader(isfs))
             {
                 textbox.Text = sr.ReadToEnd();
                 sr.Close();
             }
         }
     }
 }
Пример #55
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            var colors      = new List <ColorSelectModel>();
            var accentColor = (Color)Resources["PhoneAccentColor"];

            colors.Add(new ColorSelectModel("Accent Color", accentColor));
            colors.AddRange(
                typeof(Colors).GetProperties(BindingFlags.Static | BindingFlags.Public)
                .Where(p => p.PropertyType == typeof(Color))
                .Where(p => p.Name != "Transperant" && p.Name != "Black")
                .Select(p => new ColorSelectModel(p.Name, (Color)p.GetValue(typeof(Colors), null))));
            listPickerColor.ItemsSource     = listPickerColor.ItemsSource ?? new ObservableCollection <ColorSelectModel>(colors);
            listPickerBallColor.ItemsSource = listPickerColor.ItemsSource ?? new ObservableCollection <ColorSelectModel>(colors);
            this.Background = new SolidColorBrush(Colors.Black);

            Helper.BackgroundColor = (listPickerColor.SelectedItem as ColorSelectModel).ColorBrush;
            Helper.BallColor       = (listPickerBallColor.SelectedItem as ColorSelectModel).ColorBrush;
        }
Пример #56
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (IsolatedStorageSettings.ApplicationSettings.Contains("LocationConsent"))
            {
                //User already gave us his agreement for using his position
                if ((bool)IsolatedStorageSettings.ApplicationSettings["LocationConsent"] == true)
                {
                    return;
                }
                //If he didn't we ask for it
                else
                {
                    MessageBoxResult result = MessageBox.Show("Can I use your position?", "Location", MessageBoxButton.OKCancel);

                    if (result == MessageBoxResult.OK)
                    {
                        IsolatedStorageSettings.ApplicationSettings["LocationConsent"] = true;
                    }
                    else
                    {
                        IsolatedStorageSettings.ApplicationSettings["LocationConsent"] = false;
                    }

                    IsolatedStorageSettings.ApplicationSettings.Save();
                }
            }

            //Ask for user agreement in using his position
            else
            {
                MessageBoxResult result = MessageBox.Show("Can I use your position?", "Location", MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.OK)
                {
                    IsolatedStorageSettings.ApplicationSettings["LocationConsent"] = true;
                }
                else
                {
                    IsolatedStorageSettings.ApplicationSettings["LocationConsent"] = false;
                }

                IsolatedStorageSettings.ApplicationSettings.Save();
            }
        }
Пример #57
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            //m_bInThisApp = true;

            if (!m_bFirstLoad)
            {
                return;
            }
            m_bFirstLoad = false;

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput("RscViewer_JSonV10");
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                m_iIndex = 0;
                if (!Int32.TryParse(m_AppInput.GetFlag(0), out m_iIndex))
                {
                    return;
                }

                m_aPathes.Clear();
                for (int i = 0; i < m_AppInput.DataCount; i++)
                {
                    string sPath = m_AppInput.GetData(i);

                    m_aPathes.Add(sPath);
                }
                if (m_aPathes.Count == 0)
                {
                    return;
                }

                m_iIndex = Math.Min(m_iIndex, m_AppInput.DataCount - 1);
                m_iIndex = Math.Max(m_iIndex, 0);

                //appArgsMgr.Vipe();

                _ReadTextFile();
            }
        }
Пример #58
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string tag = "";

            if (NavigationContext.QueryString.TryGetValue("imageTag", out tag))
            {
                string     url        = App.ImagesUrl[Convert.ToInt32(tag)];
                WebBrowser webBrowser = new WebBrowser();
                webBrowser.Navigate(new Uri(url, UriKind.Absolute));
                webBrowser.Navigated        += new EventHandler <NavigationEventArgs>(NavigateHandler);
                webBrowser.NavigationFailed += WebBrowser_NavigationFailed;
                webBrowser.Margin.Top.Equals(-12);
                webBrowser.IsScriptEnabled = true;
                browserGrid.Children.Add(webBrowser);
                imageName.Text = App.ImagesName[Convert.ToInt32(tag)];
            }
        }
Пример #59
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            App thisApp = App.Current as App;

            if ((thisApp.ConvertFrom != null) && (thisApp.ConvertFrom != ""))
            {
                comboBoxDe.SelectedItem = thisApp.ConvertFrom;
            }

            if ((thisApp.ConvertTo != null) && (thisApp.ConvertTo != ""))
            {
                comboBoxPara.SelectedItem = thisApp.ConvertTo;
            }

            textBoxResultado.Text  = thisApp.OutputValue;
            textBoxQuantidade.Text = thisApp.InputValue;
        }
Пример #60
-1
        private void frm_nav_Navigated(object sender, NavigationEventArgs e)
        {
            double translateTo = 0.0, translateFrom = 0.0;
            var currentStep = (int)App.Current.Properties[Constants.ApplicationProperties.CurrentStep];
            var nextStep = (int)App.Current.Properties[Constants.ApplicationProperties.NextStep];

            //switch (currentStep)
            //{
            //    case Constants.ApplicationProperties.Steps.step1:
            //        translateTo = txb_pg1.Margin.Top - rectangle1.Margin.Top;
            //        break;
            //    case Constants.ApplicationProperties.Steps.step2:
            //        translateTo = txb_pg2.Margin.Top - rectangle1.Margin.Top;
            //        translateFrom = txb_pg1.Margin.Top;
            //        break;
            //    case Constants.ApplicationProperties.Steps.step3:
            //        translateTo = txb_pg2.Margin.Top - rectangle1.Margin.Top;
            //        translateFrom = txb_pg1.Margin.Top;
            //        break;
            //    default:
            //        break;
            //}

            translateTo = nextStep;
            translateFrom = currentStep;


            App.Current.Properties["stepSlider"] = translateTo;
            var transform = new TranslateTransform();
            Duration duration = new Duration(new TimeSpan(0, 0, 0, 2, 0));
            DoubleAnimation anim = new DoubleAnimation(translateFrom, translateTo, duration);
            transform.BeginAnimation(TranslateTransform.YProperty, anim);
            rectangle1.RenderTransform = transform;
        }