Пример #1
0
        protected override void Start()
        {
            base.Start();

            var souvenirBar     = transform.FindChild(Constants.SouvenirBar);
            var confirmationBar = transform.FindChild(Constants.ConfirmationBar);

            // Gets the holobar buttons
            adjustButton  = souvenirBar.FindChild(Constants.AdjustButton).gameObject.GetComponent <HoloBarButton>();
            cancelButton  = confirmationBar.FindChild(Constants.CancelButton).gameObject.GetComponent <HoloBarButton>();
            confirmButton = confirmationBar.FindChild(Constants.ConfirmButton).gameObject.GetComponent <HoloBarButton>();

            // Attaches the clicked events to the buttons
            adjustButton.Clicked  += () => { RaiseIfNotInConfirmationState(AdjustClicked); };
            cancelButton.Clicked  += () => { CancelClicked.RaiseEvent(); };
            confirmButton.Clicked += () => { ConfirmClicked.RaiseEvent(); };

            // Sets up the voice commands
            keywords.Add(VoiceCommandsManager.AdjustKeyword, () => { RaiseIfNotInConfirmationState(AdjustClicked); });
            keywords.Add(VoiceCommandsManager.CancelKeyword, () => { CancelClicked.RaiseEvent(); });
            keywords.Add(VoiceCommandsManager.ConfirmKeyword, () => { ConfirmClicked.RaiseEvent(); });

            // Attaches the holobar flow methods to the buttons
            AdjustClicked  += () => { ChangeBar(Constants.ConfirmationBar); };
            CancelClicked  += () => { ChangeBar(Constants.SouvenirBar); };
            ConfirmClicked += () => { ChangeBar(Constants.SouvenirBar); };
        }
 private void CancelClick(object sender, RoutedEventArgs e)
 {
     if (CancelClicked != null)
     {
         CancelClicked.Invoke(this, e);
     }
 }
Пример #3
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (CancelClicked != null)
     {
         CancelClicked.Invoke(this, EventArgs.Empty);
     }
 }
Пример #4
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (!_initialized)
     {
         return;
     }
     CancelClicked?.Invoke(this, new EventArgs());
 }
        private void OnCancelClicked()
        {
            Hide();

            chooseButton.interactable = false;

            DeactiveAllSelectedClasses();

            CancelClicked?.Invoke();
        }
Пример #6
0
        internal async void CancelClickedInternal()
        {
            CancelClicked?.Invoke(this, EventArgs.Empty);
            if (CancelCommand is not CancelSheetCommand)
            {
                IsOpen = false;
                return;
            }

            if (CancelCommand is CancelSheetCommand cancelSheetCommand &&
                await cancelSheetCommand.CanCloseSheet(CancelCommandParameter))
            {
                IsOpen = false;
            }
        }
Пример #7
0
 public void CancelBtnCommandAction(Object param)
 {
     CancelClicked.DoNotify(this);
 }
Пример #8
0
 /// <summary>
 /// The button cancel_ click.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 private void OnCancelButtonClick(object sender, RoutedEventArgs e)
 {
     CancelClicked?.Invoke(this, new RoutedEventArgs());
 }
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     CancelChanges();
     CancelClicked?.Invoke(this, e);
 }
Пример #10
0
 private void OnCancelClicked(object sender, EventArgs e)
 {
     CancelClicked?.Invoke(this, e);
 }
Пример #11
0
 private void Button_cancel_Click(object sender, EventArgs e)
 {
     // fire the external event so the subscribed presenter can react
     CancelClicked?.Invoke(this, e);
 }
Пример #12
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     CancelClicked?.Invoke(sender, e);
 }
Пример #13
0
 private void OnCancelClicked()
 {
     CancelClicked?.Invoke(this, new EventArgs());
 }
Пример #14
0
 /// <summary>
 /// Helper functions to let renderers to fire the CancelClicked event
 /// </summary>
 public void FireCancelEvent()
 {
     CancelClicked?.Invoke(this, EventArgs.Empty);
 }
Пример #15
0
 private void CancelTransfer_Click(object sender, EventArgs e)
 {
     CancelClicked?.Invoke(sender, e);
 }
Пример #16
0
 /// <summary>
 /// Fires the Cancel Clicked event.
 /// </summary>
 protected virtual void OnCancelClicked()
 {
     CancelClicked?.Invoke(this, EventArgs.Empty);
 }
Пример #17
0
        public DatePickerView()
        {
            _datePicker = new BlankDatePicker
            {
                BackgroundColor   = Color.Transparent,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };
            _datePicker.SetBinding(DatePicker.FontAttributesProperty,
                                   new Binding(nameof(EntryFontAttributes))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.FontFamilyProperty,
                                   new Binding(nameof(EntryFontFamily))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.FontSizeProperty,
                                   new Binding(nameof(EntryFontSize))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.PlaceholderProperty,
                                   new Binding(nameof(EntryPlaceholder))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.PlaceholderColorProperty,
                                   new Binding(nameof(EntryPlaceholderColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.HorizontalTextAlignmentProperty,
                                   new Binding(nameof(EntryHorizontalTextAlignment))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.TextColorProperty,
                                   new Binding(nameof(EntryTextColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(HeightRequestProperty,
                                   new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            _datePicker.SetBinding(DatePicker.FormatProperty,
                                   new Binding(nameof(Format))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.MinimumDateProperty,
                                   new Binding(nameof(MinimumDate))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.MaximumDateProperty,
                                   new Binding(nameof(MaximumDate))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(DatePicker.DateProperty,
                                   new Binding(nameof(Date))
            {
                Source = this, Mode = BindingMode.TwoWay
            });

            _datePicker.SetBinding(BlankDatePicker.DoneButtonTextProperty,
                                   new Binding(nameof(DoneButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.CancelButtonTextProperty,
                                   new Binding(nameof(CancelButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            _pFrame = new Frame
            {
                Padding         = 0,
                HasShadow       = false,
                BackgroundColor = Color.Transparent,
                Content         = _datePicker
            };
            _pFrame.SetBinding(IsEnabledProperty,
                               new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay, Converter = new InverseBooleanConverter()
            });
            _pFrame.SetBinding(InputTransparentProperty,
                               new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _pFrame.SetBinding(HeightRequestProperty,
                               new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            TextAlignmentCommand = new Command(() => TextAlignmentChanged());

            _datePicker.Focused      += FocusEntry;
            _datePicker.Unfocused    += UnfocusEntry;
            _datePicker.DateSelected += Date_Selected;

            _datePicker.DoneClicked   += (sender, e) => DoneClicked?.Invoke(this, e);
            _datePicker.CancelClicked += (sender, e) => CancelClicked?.Invoke(this, e);

            Children.Add(_pFrame, 2, 3, 1, 2);
        }
Пример #18
0
        public PickerView()
        {
            _picker = new BlankPicker
            {
                BackgroundColor = Color.Transparent,
            };
            _picker.SetBinding(Picker.FontAttributesProperty,
                               new Binding(nameof(EntryFontAttributes))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(Picker.FontFamilyProperty,
                               new Binding(nameof(EntryFontFamily))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(Picker.FontSizeProperty,
                               new Binding(nameof(EntryFontSize))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(BlankPicker.PlaceholderProperty,
                               new Binding(nameof(EntryPlaceholder))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(BlankPicker.PlaceholderColorProperty,
                               new Binding(nameof(EntryPlaceholderColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(BlankPicker.HorizontalTextAlignmentProperty,
                               new Binding(nameof(EntryHorizontalTextAlignment))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(Picker.TextColorProperty,
                               new Binding(nameof(EntryTextColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(HeightRequestProperty,
                               new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            _picker.SetBinding(Picker.ItemsSourceProperty,
                               new Binding(nameof(ItemsSource))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(Picker.SelectedIndexProperty,
                               new Binding(nameof(SelectedIndex))
            {
                Source = this, Mode = BindingMode.TwoWay
            });
            _picker.SetBinding(Picker.SelectedItemProperty,
                               new Binding(nameof(SelectedItem))
            {
                Source = this, Mode = BindingMode.TwoWay
            });
            _picker.SetBinding(Picker.TitleProperty,
                               new Binding(nameof(Title))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            //Todo For Xamarin.Forms 4.0
            //_picker.SetBinding(Picker.TitleColorProperty,
            //new Binding(nameof(TitleColor)) { Source = this, Mode = BindingMode.OneWay });

            _picker.SetBinding(BlankPicker.DoneButtonTextProperty,
                               new Binding(nameof(DoneButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _picker.SetBinding(BlankPicker.CancelButtonTextProperty,
                               new Binding(nameof(CancelButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            _pFrame = new Frame
            {
                Padding         = 0,
                HasShadow       = false,
                BackgroundColor = Color.Transparent,
                Content         = _picker
            };
            _pFrame.SetBinding(IsEnabledProperty,
                               new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay, Converter = new InverseBooleanConverter()
            });
            _pFrame.SetBinding(InputTransparentProperty,
                               new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _pFrame.SetBinding(HeightRequestProperty,
                               new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            TextAlignmentCommand = new Command(() => TextAlignmentChanged());

            _picker.Focused              += FocusEntry;
            _picker.Unfocused            += UnfocusEntry;
            _picker.SelectedIndexChanged += IndexChanged;

            _picker.DoneClicked   += (sender, e) => DoneClicked?.Invoke(this, e);
            _picker.CancelClicked += (sender, e) => CancelClicked?.Invoke(this, e);

            Children.Add(_pFrame, 2, 3, 1, 2);
        }
Пример #19
0
 private void BtnCancel_LeftClick(object sender, EventArgs e)
 {
     Hide();
     CancelClicked?.Invoke(this, EventArgs.Empty);
 }
Пример #20
0
 public void OnCancelClicked(object pSender, EventArgs pEventArgs)
 {
     CancelClicked?.Invoke(this, pEventArgs);
     DialogResult = DialogResult.Cancel;
     base.Close();
 }
Пример #21
0
 /// <summary>
 /// The on cancel clicked.
 /// </summary>
 public void OnCancelClicked()
 {
     CancelClicked?.Invoke(this, new RoutedEventArgs());
 }
Пример #22
0
 private void OnCancel()
 {
     CancelClicked?.Invoke(this);
 }
Пример #23
0
        public DatePickerView()
        {
            _datePicker = new BlankDatePicker
            {
                BackgroundColor = Color.Transparent
            };
            Input = _datePicker;
            _datePicker.SetBinding(Entry.TextProperty,
                                   new Binding(nameof(EntryText))
            {
                Source = this, Mode = BindingMode.TwoWay
            });
            _datePicker.SetBinding(Entry.FontAttributesProperty,
                                   new Binding(nameof(EntryFontAttributes))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.FontFamilyProperty,
                                   new Binding(nameof(EntryFontFamily))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.FontSizeProperty,
                                   new Binding(nameof(EntryFontSize))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.PlaceholderProperty,
                                   new Binding(nameof(EntryPlaceholder))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.PlaceholderColorProperty,
                                   new Binding(nameof(EntryPlaceholderColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.HorizontalTextAlignmentProperty,
                                   new Binding(nameof(EntryHorizontalTextAlignment))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(Entry.TextColorProperty,
                                   new Binding(nameof(EntryTextColor))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(HeightRequestProperty,
                                   new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(MarginProperty,
                                   new Binding(nameof(EntryMargin))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            //_datePicker.SetBinding(BlankDatePicker.FormatProperty,
            //    new Binding(nameof(Format)) { Source = this, Mode = BindingMode.OneWay });
            //_datePicker.SetBinding(BlankDatePicker.MinimumDateProperty,
            //    new Binding(nameof(MinimumDate)) { Source = this, Mode = BindingMode.OneWay });
            //_datePicker.SetBinding(BlankDatePicker.MaximumDateProperty,
            //    new Binding(nameof(MaximumDate)) { Source = this, Mode = BindingMode.OneWay });
            //_datePicker.SetBinding(BlankDatePicker.DateProperty,
            //    new Binding(nameof(Date)) { Source = this, Mode = BindingMode.TwoWay });

            _datePicker.SetBinding(IsEnabledProperty,
                                   new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay, Converter = new InverseBooleanConverter()
            });
            _datePicker.SetBinding(InputTransparentProperty,
                                   new Binding(nameof(IsReadOnly))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(HeightRequestProperty,
                                   new Binding(nameof(EntryHeightRequest))
            {
                Source = this, Mode = BindingMode.OneWay
            });

            _datePicker.SetBinding(BlankDatePicker.DoneButtonTextProperty,
                                   new Binding(nameof(DoneButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.CancelButtonTextProperty,
                                   new Binding(nameof(CancelButtonText))
            {
                Source = this, Mode = BindingMode.OneWay
            });
            _datePicker.SetBinding(BlankDatePicker.UpdateModeProperty,
                                   new Binding(nameof(UpdateMode))
            {
                Source = this, Mode = BindingMode.OneWay
            });


            _datePicker.Focused      += FocusEntry;
            _datePicker.Unfocused    += UnfocusEntry;
            _datePicker.DateSelected += Date_Selected;
            _datePicker.TextChanged  += SendEntryTextChanged;

            _datePicker.DoneClicked   += (sender, e) => DoneClicked?.Invoke(this, e);
            _datePicker.CancelClicked += (sender, e) => CancelClicked?.Invoke(this, e);

            FloatingLabelWithoutAnimation();

            Children.Add(_datePicker, 2, 3, 1, 2);
        }
Пример #24
0
 private void CancelSync()
 {
     CancelClicked?.Invoke(this, new EventArgs());
 }
Пример #25
0
 private void CancelButton_OnClick(object sender, RoutedEventArgs e)
 {
     CancelClicked?.Invoke(this, EventArgs.Empty);
 }
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     CancelClicked?.Invoke(sender, e);
 }
Пример #27
0
 protected virtual void OnCancelClicked(EventArgs e)
 {
     CancelClicked?.Invoke(this, e);
 }
Пример #28
0
 public IEnumerable <Delegate> CancelSubscribers()
 {
     return(CancelClicked == null?Enumerable.Empty <Delegate>() : CancelClicked.GetInvocationList());
 }