상속: System.Dynamic.DynamicObject, IDynamicMetaObjectProvider
        private void SetCommands()
        {
            this.ShowImageCommand = new RelayCommand(() =>
            {
                dynamic pars = new DynamicNavigationParameters();
                pars.Attachment = this;
                (Window.Current.Content as Frame).Navigate(typeof(FeedbackImagePage), pars);
            });

            SaveImageCommand = new RelayCommand(async () =>
            {
                ImageBuffer = await Canvas.SaveAsPngIntoBufferAsync();
                InitialImage = await ImageBuffer.AsBitmapImageAsync();
                (Window.Current.Content as Frame).Navigate(typeof(FeedbackFormPage), this);
            });
            DeleteImageCommand = new RelayCommand(() =>
            {
                MarkedAsDeleted = true;
                (Window.Current.Content as Frame).Navigate(typeof(FeedbackFormPage), this);
            });
            ResetImageCommand = new RelayCommand(() =>
            {
                Canvas.Children.Clear();
                Canvas.Background = InitialImage.AsImageBrush();
            });
            CloseImageCommand = new RelayCommand(() => { (Window.Current.Content as Frame).GoBack(); });

        }
예제 #2
0
 protected void ShowLoginScreen(AuthenticationMode authMode, string appSecret, string email, AuthValidationMode authValidationMode)
 {
     dynamic parms = new DynamicNavigationParameters();
     parms.authmode = authMode;
     parms.appsecret = appSecret;
     parms.email = email;
     parms.validationmode = authValidationMode;
     this.Frame.Navigate(typeof(LoginPage), parms);
 }
        private void SetCommands()
        {
            // Window.Current can be null in case of application is suspended.
            // issue discussed at https://support.hockeyapp.net/discussions/problems/57803-hockeysdkwinrt-version-223-bug
            Frame rootFrame = Window.Current == null ?  null : (Window.Current.Content as Frame);

            CancelCommand = new RelayCommand(() =>
            {
                if (rootFrame != null)
                {
                    rootFrame.GoBack();
                }
            });

            SendCommand = new RelayCommand(async () =>
            {
                bool success = true;
                if (await ValidateInputAsync())
                {
                    if(NetworkInterface.GetIsNetworkAvailable())
                    {
                    this.IsBusy = true;
                    try
                    {
                        IFeedbackMessage sentMessage = await this.SendFeedbackAsync();
                        await FeedbackManager.Current.ClearMessageCacheAsync();
                        await AfterSendActionAsync(sentMessage);
                    }
                    catch (WebException e)
                    {
                        HockeyClient.Current.AsInternal().HandleInternalUnhandledException(e);
                        success = false;
                    }
                    finally
                    {
                        this.IsBusy = false;
                    }
                    if (!success)
                    {
                        await new MessageDialog(LocalizedStrings.LocalizedResources.FeedbackSendError).ShowAsync();
                    }
                    } 
                    else
                    {
                        await new MessageDialog(LocalizedStrings.LocalizedResources.FeedbackNoInternet).ShowAsync();
                    }
                }
            });

            AttachImgCommand = new RelayCommand(() =>
            {
                PickPhoto();
            });

            EditAttachmentCommand = new RelayCommand((attachVM) =>
            {
                var vm = attachVM as FeedbackAttachmentVM;
                vm.IsNewAttachment = false;
                dynamic pars = new DynamicNavigationParameters();
                pars.Attachment = vm;
                if (rootFrame != null)
                {
                    rootFrame.Navigate(this.FeedbackImagePageType, pars);
                }
            });

        }
예제 #4
0
 internal void NavigateToUpdatePage(Version currentVersion, IEnumerable<IAppVersion> appVersions, UpdateCheckSettings updateCheckSettings)
 {
     var rootFrame = Window.Current.Content as Frame;
     dynamic parms = new DynamicNavigationParameters();
     parms.currentVersion = currentVersion;
     parms.appVersions = appVersions;
     parms.updateCheckSettings = updateCheckSettings;
     
     rootFrame.Navigate(typeof(UpdatePage), parms);
 }
 /// <summary>
 /// You need to call this method in your App's OnActivated method if you use the feedback feature. This allows for HockeyApp to continue after a
 /// PickFileAndContinue resume when adding images as attachments to a message
 /// </summary>
 /// <param name="this"></param>
 /// <param name="e"></param>
 /// <returns>true if the reactivation occured because of Feedback Filepicker</returns>
 public static bool HandleReactivationOfFeedbackFilePicker(this IHockeyClient @this, IActivatedEventArgs e)
 {
     var continuationEventArgs = e as IContinuationActivatedEventArgs;
     if (continuationEventArgs != null && ActivationKind.PickFileContinuation.Equals(continuationEventArgs.Kind))
     {
         var args = (FileOpenPickerContinuationEventArgs)e;
         if (args.ContinuationData.ContainsKey(FeedbackManager.FilePickerContinuationKey))
         {
             if (args.Files.Count > 0)
             {
                 dynamic pars = new DynamicNavigationParameters();
                 pars.ImageFile = args.Files[0];
                 ((Window.Current.Content) as Frame).Navigate(typeof(FeedbackImagePage), pars);
                 return true;
             }
             else
             {
                 ((Window.Current.Content) as Frame).Navigate(typeof(FeedbackFormPage));
                 return true;
             }
         }
     }
     return false;
 }
        /// <summary>
        /// Invoke this method to navigate to the feedback UI where a user can send you a message including image attachments over the HockeyApp feedback system.
        /// Make sure to add a call to HockeyClient.Current.HandleReactivationOfFeedbackFilePicker(..) to your App's OnActivated() method to allow for resuming 
        /// the process after PickFileAndContinue..
        /// </summary>
        /// <param name="this"></param>
        /// <param name="initialUsername">[Optional] Username to prefill the name field</param>
        /// <param name="initialEmail">[Optional] Email to prefill the email field</param>
        public static void ShowFeedback(this IHockeyClient @this, string initialUsername = null, string initialEmail = null)
        {
            HockeyClient.Current.AsInternal().CheckForInitialization();

            dynamic pars = new DynamicNavigationParameters();
            pars.IsCallFromApp = true;
            FeedbackManager.Current.InitialEmail = initialEmail;
            FeedbackManager.Current.InitialUsername = initialUsername;
            var frame = Window.Current.Content as Frame;
            frame.Navigate(typeof(FeedbackMainPage), pars);
        }