コード例 #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            model.Title = NavigationContext.QueryString["title"];

            var       gameType  = NavigationContext.QueryString["gametype"];
            Exception exception = null;

            try
            {
                await model.Init(gameType);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            if (exception != null)
            {
                ToastPrompt toast = new ToastPrompt()
                {
                    Title                   = "Error",
                    Message                 = exception.Message,
                    TextOrientation         = System.Windows.Controls.Orientation.Vertical,
                    MillisecondsUntilHidden = 4000
                };
                //toast.ImageSource = new BitmapImage(new Uri("ApplicationIcon.png", UriKind.RelativeOrAbsolute));
                //toast.Completed += toast_Completed;
                toast.Show();
                BugSenseLogResult result = await BugSenseHandler.Instance.LogExceptionAsync(exception);

                Debug.WriteLine("Client Request: {0}", result.ClientRequest);
            }
        }