private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { Pivot pivot = sender as Pivot; if (pivot == null) { return; } switch (pivot.SelectedIndex) { case 0: HubTileService.UnfreezeGroup("Food"); HubTileService.FreezeGroup("Places"); HubTileService.FreezeGroup("Sizes"); break; case 1: HubTileService.FreezeGroup("Food"); HubTileService.UnfreezeGroup("Places"); HubTileService.FreezeGroup("Sizes"); break; case 2: HubTileService.FreezeGroup("Food"); HubTileService.FreezeGroup("Places"); HubTileService.UnfreezeGroup("Sizes"); break; } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { await MyOnNavigatedTo(); this.SetProgressIndicator(true, "đang mở..."); Binding(); HubTileService.UnfreezeGroup("Publishers"); this.SetProgressIndicator(false); this.SetMainPage(); base.OnNavigatedTo(e); }
private void pano_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (pano.SelectedIndex != 2 || this.ViewModel.IsInProgress) { HubTileService.FreezeGroup("Latest"); } else { HubTileService.UnfreezeGroup("Latest"); } this.MainPageViewModel.CurrentSectionIndex = pano.SelectedIndex; }
private void pivotNumbers_SelectionChanged(object sender, SelectionChangedEventArgs e) { var itm = e.AddedItems[0] as NumberInfo; var olditm = e.RemovedItems[0] as NumberInfo; if (e.RemovedItems[0] != null) { HubTileService.FreezeGroup(olditm.Number); } if (e.AddedItems[0] != null) { HubTileService.UnfreezeGroup(itm.Number); } }
private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { var pivot = (sender as Pivot); if (pivot.SelectedIndex == 0) { HubTileService.UnfreezeGroup("food"); HubTileService.FreezeGroup("places"); HubTileService.FreezeGroup("people"); } else if (pivot.SelectedIndex == 1) { HubTileService.UnfreezeGroup("places"); HubTileService.FreezeGroup("food"); HubTileService.FreezeGroup("people"); } else { HubTileService.FreezeGroup("food"); HubTileService.FreezeGroup("places"); HubTileService.UnfreezeGroup("people"); } }
/// <summary> /// Called when the user navigates between panoramas; changes the appbar to show different possibilities per panorama. /// </summary> private void OnPanoramaSelectionChanged(object sender, SelectionChangedEventArgs e) { switch (((Panorama)sender).SelectedIndex) { // What's New PanoramaItem case 0: HubTileService.FreezeGroup("featured"); break; // Featured PanoramaItem case 1: ApplicationBar.Mode = ApplicationBarMode.Minimized; ApplicationBar.Buttons.Clear(); HubTileService.UnfreezeGroup("featured"); break; // All Categories/Feeds PanoramaItem case 2: ApplicationBar.Mode = ApplicationBarMode.Default; ApplicationBarIconButton addButton = new ApplicationBarIconButton { Text = AppResources.MainPageAppBarAddText, IconUri = new Uri("/Icons/appbar.add.rest.png", UriKind.Relative) }; addButton.Click += OnAddClick; ApplicationBar.Buttons.Add(addButton); HubTileService.FreezeGroup("featured"); break; // Settings PanoramaItem case 3: ApplicationBar.Mode = ApplicationBarMode.Minimized; ApplicationBar.Buttons.Clear(); HubTileService.FreezeGroup("featured"); break; } }
public virtual void OnHidden() { HubTileService.FreezeGroup(this.GroupTag); }
public virtual void OnDisplayed() { HubTileService.UnfreezeGroup(this.GroupTag); }
void ParseRSSAndBindData(string RSSString, string Title) { try { XElement iNews = XElement.Parse(RSSString); var postList = from tweet in iNews.Descendants("item") select new PostMessage { title = tweet.Element("title").Value, mainImage = allFunc.GetImageFromPostContents(tweet.Element("description").Value), description = Regex.Replace(tweet.Element("description").Value, "<.*?>", String.Empty), pubDate = Convert.ToDateTime(tweet.Element("pubDate").Value).ToString(), link = tweet.Element("link").Value }; PanoramaItem iPanoramaItem = new PanoramaItem(); iPanoramaItem.Header = Title; iPanoramaItem.Orientation = System.Windows.Controls.Orientation.Horizontal; ScrollViewer iScrollViewer = new ScrollViewer(); StackPanel mStackPanel = new StackPanel(); mStackPanel.Margin = new Thickness(0, 4, 16, 0); mStackPanel.Orientation = System.Windows.Controls.Orientation.Vertical; mStackPanel.VerticalAlignment = System.Windows.VerticalAlignment.Top; SolidColorBrush backColor = new SolidColorBrush(Color.FromArgb(0xFF, 0xDF, 0xD6, 0xAB)); SolidColorBrush foreColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x3A, 0x3A, 0x3A)); StackPanel firstStackPanel = new StackPanel(); StackPanel secondStackPanel = new StackPanel(); StackPanel thirdStackPanel = new StackPanel(); firstStackPanel.Orientation = System.Windows.Controls.Orientation.Horizontal; secondStackPanel.Orientation = System.Windows.Controls.Orientation.Horizontal; secondStackPanel.Margin = new Thickness(0, 12, 0, 0); thirdStackPanel.Orientation = System.Windows.Controls.Orientation.Horizontal; thirdStackPanel.Margin = new Thickness(0, 12, 0, 0); int i = 0; foreach (var iNew in postList) { HubTile iHubTile = new HubTile(); iHubTile.Margin = new Thickness(12, 0, 0, 0); iHubTile.Title = iNew.pubDate.ToString(); // Title; iHubTile.Message = iNew.title; iHubTile.Notification = iNew.title; iHubTile.Source = new BitmapImage(new Uri(iNew.mainImage, UriKind.Absolute)); iHubTile.Background = backColor; iHubTile.Foreground = foreColor; iHubTile.Tag = iNew.link; iHubTile.Tap += ShowWebNew; iHubTile.GroupTag = Title; iHubTile.Name = Title + i.ToString(); iHubTile.Size = TileSize.Medium; if (i > 6) { thirdStackPanel.Children.Add(iHubTile); } else if (i > 3) { secondStackPanel.Children.Add(iHubTile); } else { HubTileService.FreezeHubTile(iHubTile); firstStackPanel.Children.Add(iHubTile); } i++; } mStackPanel.Children.Add(firstStackPanel); mStackPanel.Children.Add(secondStackPanel); mStackPanel.Children.Add(thirdStackPanel); iScrollViewer.Content = mStackPanel; iPanoramaItem.Content = iScrollViewer; OneCity.Items.Add(iPanoramaItem); } catch { } }
private void HubTile_MouseLeave(object sender, MouseEventArgs e) { HubTileService.UnfreezeGroup("Freeze"); }
private void Freeze_Over(object sender, MouseEventArgs e) { HubTileService.FreezeGroup("Freeze"); }
private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e) { HubTileService.UnfreezeGroup("PopularTiles"); }