public void GetPhoto(GetPhotoCallback callback)
 {
     this.getPhotoCallback = callback;
     MessagePrompt questionMessage = new MessagePrompt();
     questionMessage.Title = "Choose source:";
     SelectPhotoDialog dialogContent = new SelectPhotoDialog();
     dialogContent.TakePhotoCommand = new DelegateCommand((o) =>
         {
             questionMessage.Hide();
             this.photoCameraCapture.Show();
         });
     dialogContent.ChosePhotoCommand = new DelegateCommand((o) =>
         {
             questionMessage.Hide();
             this.photoChooserTask.Show();
         });
     dialogContent.RandomPhotoCommand = new DelegateCommand((o) =>
         {
             questionMessage.Hide();
             callback(null);
         });
     questionMessage.Body = dialogContent;
     RoundButton cancelButton = new RoundButton();
     cancelButton.ImageSource = new BitmapImage(new Uri("/Resources/icons/appbar.stop.rest.png", UriKind.Relative));
     cancelButton.Click += (sender, args) =>
         {
             questionMessage.Hide();
         };
     questionMessage.ActionPopUpButtons.Clear();
     questionMessage.ActionPopUpButtons.Add(cancelButton);
     questionMessage.Show();
 }
示例#2
0
        private void Privacy_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            MessagePrompt mp = new MessagePrompt
            {
                BorderThickness = new Thickness(0, 0, 0, 0),
                Title = "定位服务隐私声明"
            };


            var body = new Grid();
            body.Children.Add(new TextBlock
            {
                Text = @"噪音地图将使用Microsoft定位服务来使用你的地理位置信息。
你的地理位置信息将会保存一段时间。如果你不希望使用的地理位置信息,请点击“取消”按钮。你可以随时到“设置”页面中开启或关闭“定位服务”。
在下述情况下噪音地图需要使用你的地理位置信息:
(1)分享到微博
(2)上传到地图。

使用Microsoft位置服务代表你同意Microsoft收集有关你的位置信息,以提供和改进其地图和位置服务。有关详情,请阅读Microsoft隐私声明(http://www.windowsphone.com/zh-cn/how-to/wp7/start/welcome)。"
            ,
                TextWrapping = TextWrapping.Wrap
            });

            mp.Body = body;
            var btnComplete = new Button { Content = "确认" };
            btnComplete.Click += (o, args) =>
            {
                mp.Hide();
            };

            mp.Show();
        }
示例#3
0
 void ShowSaveDialog()
 {
     confirmPopupOpened = true;
     MessagePrompt prompt = new MessagePrompt();
     ConfirmationPage page = new ConfirmationPage(AppResources.ConfirmSaveText);
     page.Closed += (o, e) =>
     {
         confirmPopupOpened = false;
         prompt.Hide();
     };
     prompt.Completed += (o, e) =>
     {
         confirmPopupOpened = false;
     };
     page.Confirmed += (o, e) =>
     {
         confirmPopupOpened = false;
         prompt.Hide();
         EmulatorSettings.Current.HideConfirmationDialogs = page.DoNotShowAgain;
         this.m_d3dBackground.SaveState();
     };
     prompt.Body = page;
     prompt.ActionPopUpButtons.Clear();
     prompt.Overlay = new SolidColorBrush(Color.FromArgb(155, 41, 41, 41));
     prompt.Show();
 }
示例#4
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            //Clock = new Timer(new TimerCallback(TimerProc));
            if (IsolatedStorageSettings.ApplicationSettings.Contains("EnableLocation"))
            {
                bool enableLocationIsChecked = (bool?)IsolatedStorageSettings.ApplicationSettings["EnableLocation"] ?? true;
                if (enableLocationIsChecked)
                {
                    this.StartGeo();
                }
            }
            else
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    try
                    {
                        MessagePrompt mp = new MessagePrompt
                        {
                            BorderThickness= new Thickness(0,0,0,0),
                            Title = "定位服务",
                            IsCancelVisible = true
                        };

                        
                            var body = new Grid();
                            body.Children.Add(new TextBlock
                            {
                                Text = @"噪音地图将使用Microsoft定位服务来使用你的地理位置信息。
你的地理位置信息将会保存一段时间。如果你不希望使用的地理位置信息,请点击“取消”按钮。你可以随时到“设置”页面中开启或关闭“定位服务”。
在下述情况下噪音地图需要使用你的地理位置信息:
(1)分享到微博
(2)上传到地图。

使用Microsoft位置服务代表你同意Microsoft收集有关你的位置信息,以提供和改进其地图和位置服务。有关详情,请阅读Microsoft隐私声明(http://www.windowsphone.com/zh-cn/how-to/wp7/start/welcome)。"
                            ,
                                TextWrapping = TextWrapping.Wrap
                            });

                            mp.Body = body;

                        var btnHide = new Button { Content = "取消" };
                        btnHide.Click += (o, args) =>
                        {
                            mp.Hide();
                            IsolatedStorageSettings.ApplicationSettings["EnableLocation"] = false;
                        };

                        var btnComplete = new Button { Content = "确认" };
                        btnComplete.Click += (o, args) =>
                        {
                            mp.Hide();
                            IsolatedStorageSettings.ApplicationSettings["EnableLocation"] = true;
                            this.StartGeo();
                        };

                        mp.ActionPopUpButtons.Clear();
                        mp.ActionPopUpButtons.Add(btnHide);
                        mp.ActionPopUpButtons.Add(btnComplete);

                        mp.Show();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButton.OKCancel);
                    }
                });
            }

            this.googleMapControl.DefaultZoomLevel = 14;
        }
		private void MessageSuperClick(object sender, RoutedEventArgs e)
		{
			var messagePrompt = new MessagePrompt
			{
				Title = "Advanced Message",
				Background = _naturalBlueSolidColorBrush,
				Foreground = _aliceBlueSolidColorBrush,
				Overlay = _cornFlowerBlueSolidColorBrush,
			};

			var btnHide = new RoundButton { Content = "Hide" };
			btnHide.Click += (o, args) => messagePrompt.Hide();

			var btnComplete = new RoundButton { Content = "Complete" };
			btnComplete.Click += (o, args) => messagePrompt.OnCompleted(new PopUpEventArgs<string, PopUpResult> { PopUpResult = PopUpResult.Ok, Result = "You clicked the Complete Button" });

			messagePrompt.ActionPopUpButtons.Clear();
			messagePrompt.ActionPopUpButtons.Add(btnHide);
			messagePrompt.ActionPopUpButtons.Add(btnComplete);

			messagePrompt.Completed += PopUpPromptStringCompleted;

			messagePrompt.Show();
		}
        private void TrackButton_Click(object sender, EventArgs e)
        {
            var button = sender as ApplicationBarIconButton;
            if (button.Text == "Start")
            {
                InitStopButton(button);
                var msg = new MessagePrompt
                {
                    Title = "",
                    Message = "Do you want to continue with last track or create new one?",
                };

                var createButton = new Button { Content = "Create" };
                createButton.Click += (s, args) =>
                {
                    msg.Hide();
                    CreateOrContinueResult(MessageBoxResult.OK);
                };
                var continueButton = new Button { Content = "Continue" };
                continueButton.Click += (s, args) =>
                {
                    msg.Hide();
                    CreateOrContinueResult(MessageBoxResult.Cancel);
                };

                msg.ActionPopUpButtons = new List<Button> { createButton, continueButton };
                msg.Show();

                //var result = MessageBox.Show("OK:  yes\nCancel:  continue with last one", "Create new?", MessageBoxButton.OKCancel);
                //CreateOrContinueResult(result);
            }
            else
            {
                InitStartButton(button);
                ScheduledService.StopPeriodicTask();
            }
        }