private void createSettingsFlyout(SettingsFlyout sf, Gig g)
        {
            sf.HeaderText = g.title;
            sf.FlyoutWidth = SettingsFlyout.SettingsFlyoutWidth.Wide;
            StackPanel sp = new StackPanel() { Orientation = Orientation.Vertical };
            #region Venue
            sp.Children.Add(new TextBlock() { Text = "Venue", Style = this.Resources["HeaderStyle"] as Style });
            if (g.venue.url != null)
            {
                HyperlinkButton hb = new HyperlinkButton();
                hb.Content = g.venue.Title;
                hb.Tag = g.venue.id;
                hb.Style = this.Resources["HyperStyle"] as Style;
                hb.Click+=hb_Click_Venue;
                sp.Children.Add(hb);
            }
            else
            {
                sp.Children.Add(new TextBlock { Text = g.venue.Title, Style = this.Resources["ContentStyle"] as Style });
            }
            sp.Children.Add(new TextBlock() { Text = "Artists", Style = this.Resources["HeaderStyle"] as Style });
            #endregion
            #region Artists
            StackPanel artistPanel = new StackPanel();
            foreach (string s in g.artists.artist)
            {
                HyperlinkButton hb = new HyperlinkButton() { Content = s, Style = this.Resources["HyperStyle"] as Style };
                hb.Click += hb_Click;
                artistPanel.Children.Add(hb);
            }
            sp.Children.Add(artistPanel);
            #endregion
            #region Street
            if (g.venue.location.street != "")
            {
                sp.Children.Add(new TextBlock() { Text = "Address", Style = this.Resources["HeaderStyle"] as Style });
                sp.Children.Add(new TextBlock() { Text = g.venue.location.street, Style = this.Resources["ContentStyle"] as Style });
            }
            #endregion
            #region City
            sp.Children.Add(new TextBlock() { Text = "City", Style = this.Resources["HeaderStyle"] as Style });
            sp.Children.Add(new TextBlock() { Text = g.venue.location.city, Style = this.Resources["ContentStyle"] as Style });
            #endregion
            #region Time
            sp.Children.Add(new TextBlock() { Text = "Time", Style = this.Resources["HeaderStyle"] as Style });
            sp.Children.Add(new TextBlock() { Text = g.startDate.Substring(0, g.startDate.Length-3), Style = this.Resources["ContentStyle"] as Style });
            #endregion
            sp.Children.Add(new TextBlock() { Text = "More Details", Style = this.Resources["HeaderStyle"] as Style });
            sp.Children.Add(new HyperlinkButton() { Content = g.url, NavigateUri =new Uri( g.url), Style = this.Resources["HyperStyle"] as Style });
            
            Map m = new Map();
            m.Height = 400;
            Pushpin p = new Pushpin();
            MapLayer.SetPosition(p, new Location(double.Parse(g.venue.location.point.lat), double.Parse(g.venue.location.point.longt)));
            m.Children.Add(p);
            m.ZoomLevel = 15;
            m.Credentials = MAPS_KEY;
            m.ShowScaleBar = false;
            m.ShowNavigationBar = false;
            m.SetView(new Location(double.Parse(g.venue.location.point.lat), double.Parse(g.venue.location.point.longt)));
            sp.Children.Add(m);
           
           







            sf.ContentBackgroundBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
            sf.Content = sp;
        }
Esempio n. 2
0
        private void createLiveTile(Gig[] localGigs)
        {
            
          var updater = TileUpdateManager.CreateTileUpdaterForApplication();
          updater.EnableNotificationQueue(true);
          updater.Clear();
            for (int i = 0; i < 6; i++)
            {
                XmlDocument xmltile = Windows.UI.Notifications.TileUpdateManager.GetTemplateContent(Windows.UI.Notifications.TileTemplateType.TileWideImageAndText02);
                Gig g = localGigs[i];
                XmlNodeList textElement = xmltile.GetElementsByTagName("text");
                XmlNodeList imageElement = xmltile.GetElementsByTagName("image");

                textElement[0].InnerText=g.title;
                textElement[1].InnerText=g.day+" "+g.month+" "+g.year;

                imageElement[0].Attributes[1].InnerText = g.image[3].url;
                updater.Update(new TileNotification(xmltile));

                

               
            }
        }