Beispiel #1
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            var viewModel = (InstructionSignatureViewModel)ViewModel;

            signaturePad.Clear();

            this.MimicSignaturePadDisabled(!viewModel.IsSignaturePadEnabled);

            signaturePad.BackgroundColor      = AndroidGraphics.Color.Rgb(204, 207, 209); // Match the color of an EditText
            signaturePad.SignaturePrompt.Text = string.Empty;
            signaturePad.ClearLabel.TextSize  = 20.0f;
        }
Beispiel #2
0
            public override void ViewWillAppear(bool animated)
            {
                base.ViewWillAppear(animated);

                //Clear the signature prior to appearing
                signatureView.Clear();
            }
Beispiel #3
0
 private void OnClear()
 {
     _signatureView.Clear();
     PrintedName = string.Empty;
     Email       = string.Empty;
     PictureList = new ObservableCollection <SignatureImage>();
 }
Beispiel #4
0
 private void BtnClear_Click(object sender, EventArgs e)
 {
     sign_pad.Clear();
 }
            public override void ViewDidLoad()
            {
                base.ViewDidLoad();

                clear = new UIBarButtonItem("Clear", UIBarButtonItemStyle.Bordered, (sender, e) => {
                    signatureView.Clear();
                });
                clear.SetTitleTextAttributes(new UITextAttributes {
                    TextColor = UIColor.Blue
                }, UIControlState.Normal);
                clear.SetBackgroundImage(Theme.DarkBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

                cancel = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, (sender, e) => {
                    controller.Dismiss(true);
                });
                cancel.SetTitleTextAttributes(new UITextAttributes {
                    TextColor = UIColor.Blue
                }, UIControlState.Normal);
                cancel.SetBackgroundImage(Theme.DarkBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

                save = new UIBarButtonItem("Save", UIBarButtonItemStyle.Bordered, (sender, e) => {
                    //If blank, return
                    if (signatureView.IsBlank)
                    {
                        new UIAlertView(string.Empty, "No signature!", null, "Ok").Show();
                        return;
                    }

                    if (assignmentViewModel.Signature == null)
                    {
                        assignmentViewModel.Signature = new Data.Signature {
                            AssignmentId = assignmentViewModel.SelectedAssignment.Id
                        }
                    }
                    ;

                    assignmentViewModel.Signature.Image = signatureView.GetImage().ToByteArray();

                    assignmentViewModel.SaveSignatureAsync()
                    .ContinueWith(_ => {
                        BeginInvokeOnMainThread(() => controller.Dismiss(true));
                    });
                });

                save.SetTitleTextAttributes(new UITextAttributes {
                    TextColor = UIColor.Blue
                }, UIControlState.Normal);
                save.SetBackgroundImage(Theme.DarkBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

                NavigationItem.LeftBarButtonItem = cancel;
                NavigationItem.SetRightBarButtonItems(UIDevice.CurrentDevice.CheckSystemVersion(8, 0) ?
                                                      new UIBarButtonItem [] { save, clear } :
                                                      new UIBarButtonItem [] { save },
                                                      false);

                NavigationController.NavigationBar.SetBackgroundImage(null, UIBarMetrics.Default);

                signatureView = new SignaturePadView(View.Frame)
                {
                    AutoresizingMask = UIViewAutoresizing.All
                };

                View.AddSubview(signatureView);
            }