Exemplo n.º 1
0
 protected override void LoadState(object sender, LoadStateEventArgs e)
 {
     base.LoadState(sender, e);
     if (NeedsRefresh)
     {
         _mainViewModel.LoadInitialPhotosCommand.Execute(null);
     }
 }
Exemplo n.º 2
0
        protected override async void LoadState(object sender, LoadStateEventArgs e)
        {
            base.LoadState(sender, e);
            string json= e.NavigationParameter as string;
            if (string.IsNullOrWhiteSpace(json)) return;
            var photo = JsonConvert.DeserializeObject<Photo>(json);
            if (photo == null) return;
            _mapViewModel.Photo = photo;

            //Zoom the map to the specified location with Bow animation and zoom level 14.
            await Map.TrySetViewAsync(_mapViewModel.Geopoint, 14, null, null, MapAnimationKind.Bow);
        }
 protected override void LoadState(object sender, LoadStateEventArgs e)
 {
     base.LoadState(sender, e);
     if (NeedsRefresh)
     {
         string searchTerm = e.NavigationParameter as string;
         if (String.IsNullOrWhiteSpace(searchTerm))
         {
             SearchTextBox.Text = "";
             return;
         }
         //Set Search TextBox
         SearchTextBox.Text = searchTerm;
         //load
         _searchViewModel.SearchPhotosCommand.Execute(searchTerm);
     }
 }
Exemplo n.º 4
0
        protected override void LoadState(object sender, LoadStateEventArgs e)
        {
            base.LoadState(sender, e);
            string json = e.NavigationParameter as string;
            if (string.IsNullOrWhiteSpace(json)) return;
            var photo = JsonConvert.DeserializeObject<Photo>(json);

            _mapViewModel.Photo = photo;

            //add pushpin
            string title = string.IsNullOrWhiteSpace(photo.Title) ? ViewModelLocator.Resources.Photo : photo.Title;
            SimplePushbin bin=new SimplePushbin(title);
            MapLayer.SetPosition(bin, _mapViewModel.Location);

            Map.Children.Add(bin);

            //Zoom the map to the specified location  and zoom level 16.
            Map.SetView(_mapViewModel.Location, 16);
        }
Exemplo n.º 5
0
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     LoadState(sender, e);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Ovveride this method to load your state and access passed parameter if any
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void LoadState(object sender, LoadStateEventArgs e)
 {
 }