Exemplo n.º 1
0
        private void SetUpAboutPageButtons()
        {
            const string fallingSnowUrl = "http://blogs.msdn.com/b/expression/archive/2008/12/27/creating-falling-snow-in-silverlight.aspx";

            fallingSnowLink.Click += (s, e) =>
            {
                var task = new WebBrowserTask {
                    Uri = new Uri(fallingSnowUrl)
                };
                task.Show();
            };

            reviewButton.Click += (s, e) =>
            {
                AboutFlipBack.Begin();
                var reviewTask = new MarketplaceReviewTask();
                reviewTask.Show();
            };

            sendToFriendButton.Click += (s, e) =>
            {
                const string marketplaceUrl = "http://bit.ly/acLe1V";
                var          emailTask      = new EmailComposeTask();
                emailTask.Subject = "Days Until Christmas on Windows Phone 7!";
                var sb = new StringBuilder();
                sb.Append(String.Format("Hey!\nCheck out this days until Christmas app on the Windows Phone 7 marketplace! Don't worry, it's free. \nDownload here: {0}\n", marketplaceUrl));
                sb.Append(String.Format("Only {0} {1} left until Christmas!\n", _time.DaysUntil.ToString(),
                                        (_time.DaysUntil == "01") ? "day": "days"));
                sb.Append("Merry Christmas\n");
                emailTask.Body = sb.ToString();
                emailTask.Show();
            };
        }
Exemplo n.º 2
0
        private void AboutButtonClicked(object sender, EventArgs e)
        {
            if (!_aboutScreenVisible)
            {
                AboutFlip.Begin();
                var musicButton = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                musicButton.IsEnabled = false;
            }
            else
            {
                AboutFlipBack.Begin();
                var musicButton = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                musicButton.IsEnabled = true;
            }

            _aboutScreenVisible = !_aboutScreenVisible;
        }
Exemplo n.º 3
0
 protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
 {
     if (_aboutScreenVisible)
     {
         AboutFlipBack.Begin();
         _aboutScreenVisible = false;
         e.Cancel            = true;
     }
     if (_musicScreenVisible)
     {
         MusicFlipBack.Begin();
         _musicScreenVisible = false;
         e.Cancel            = true;
     }
     foreach (ApplicationBarIconButton button in ApplicationBar.Buttons)
     {
         button.IsEnabled = true;
     }
     base.OnBackKeyPress(e);
 }