Exemplo n.º 1
0
 private void Switch_CheckedChange(object sender, CheckedChangeEventArgs e)
 {
     this.RaiseEvent("ValueChanged", new ValueChangedEventArgs <bool>(!Value, Value));
     this.OnPropertyChanged("StringValue");
     this.OnPropertyChanged("Value");
     this.OnPropertyChanged("Checked");
 }
Exemplo n.º 2
0
 private void RadioButton_CheckedChange(object sender, CheckedChangeEventArgs e)
 {
     this.RaiseEvent("ValueChanged", new ValueChangedEventArgs <bool>(!Value, Value));
     this.RaiseEvent("Clicked", EventArgs.Empty);
     this.OnPropertyChanged("StringValue");
     this.OnPropertyChanged("Value");
     this.OnPropertyChanged("Checked");
 }
 void OnCheckedChange(object sender, CheckedChangeEventArgs e)
 {
     if (Control.Checked)
     {
         Control.TrackDrawable.SetColorFilter(new BlendModeColorFilter(_view.SwitchOffColor.ToAndroid(), BlendMode.SrcAtop));
     }
     else
     {
         Control.TrackDrawable.SetColorFilter(new BlendModeColorFilter(_view.SwitchOffColor.ToAndroid(), BlendMode.SrcAtop));
     }
 }
        void OnCheckedChange(object sender, CheckedChangeEventArgs e)
        {
            if (Control.Checked)
            {
#if __ANDROID_29__
                Control.TrackDrawable.SetColorFilter(new BlendModeColorFilter(_view.SwitchOffColor.ToAndroid(), BlendMode.SrcAtop));
#else
                Control.TrackDrawable.SetColorFilter(_view.SwitchOnColor.ToAndroid(), PorterDuff.Mode.SrcAtop);
#endif
            }
            else
            {
#if __ANDROID_29__
                Control.TrackDrawable.SetColorFilter(new BlendModeColorFilter(_view.SwitchOffColor.ToAndroid(), BlendMode.SrcAtop));
#else
                Control.TrackDrawable.SetColorFilter(_view.SwitchOffColor.ToAndroid(), PorterDuff.Mode.SrcAtop);
#endif
            }
        }
Exemplo n.º 5
0
        private void FormsSegmentView_CheckedChange(object sender, CheckedChangeEventArgs e)
        {
            var rg = (RadioGroup)sender;

            if (rg.CheckedRadioButtonId == -1)
            {
                return;
            }

            var id          = rg.CheckedRadioButtonId;
            var radioButton = rg.FindViewById(id);
            var radioId     = rg.IndexOfChild(radioButton);

            var rb = (RadioButton)rg.GetChildAt(radioId);

            _currentRadioButton?.SetTextColor(TintColor);
            rb.SetTextColor(SelectedTextColor);
            UpdateButtonColors(rb);

            _currentRadioButton    = rb;
            _element.SelectedIndex = radioId;
        }
 private void OnCheckedChange(object sender, CheckedChangeEventArgs e)
 {
     SetBindingValue(Checked, "Checked");
 }
 private void BindedCheckBoxView_CheckedChange(object sender, CheckedChangeEventArgs e)
 {
     _dayCheckBox.IsChecked = Checked;
 }
Exemplo n.º 8
0
 /// <summary>
 /// CheckBoxes the checked change.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="Android.Widget.CompoundButton.CheckedChangeEventArgs"/> instance containing the event data.</param>
 private void CheckBoxCheckedChange(object sender, CheckedChangeEventArgs e)
 {
     this.Element.Checked = e.IsChecked;
 }
Exemplo n.º 9
0
            private async void ViewHolder_Select(object sender, CheckedChangeEventArgs e)
            {
                if (adpt.media != null)
                {
                    try
                    {
                        var key = $"{((!WhiteLabelConfig.PUBLIC_TOPICS) ? BootleggerClient.CurrentUser?.id : "")}-{MetaDataFields.Topics}";
                        if (!adpt.media.Static_Meta.ContainsKey(key))
                        {
                            adpt.media.Static_Meta[key] = "";
                        }


                        var mt = adpt.media.Static_Meta[key].Split(',').ToList();
                        if (e.IsChecked)
                        {
                            mt.Add(currentitem.id);
                        }
                        else
                        {
                            mt.Remove(currentitem.id);
                        }

                        //remove blanks
                        mt.RemoveAll((n) => string.IsNullOrEmpty(n));
                        if (mt.Count > 0)
                        {
                            adpt.media.Static_Meta[$"{((!WhiteLabelConfig.PUBLIC_TOPICS) ? BootleggerClient.CurrentUser?.id : "")}-{MetaDataFields.Topics}"] = string.Join(",", mt);
                        }
                        else
                        {
                            adpt.media.Static_Meta.Remove($"{((!WhiteLabelConfig.PUBLIC_TOPICS) ? BootleggerClient.CurrentUser?.id : "")}-{MetaDataFields.Topics}");
                        }

                        BootleggerClient.SaveMedia(adpt.media);
                        await BootleggerClient.UpdateMeta(adpt.media);

                        if (e.IsChecked && !adpt._readonly)
                        {
                            view.FindViewById <ToggleButton>(Resource.Id.chip).SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.baseline_check_white_24, 0);
                        }
                        else
                        {
                            view.FindViewById <ToggleButton>(Resource.Id.chip).SetCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
                        }
                    }
                    catch (Exception ex)
                    {
                        //failed
                        LoginFuncs.ShowToast(Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity, ex);
                        //Toast.MakeText(Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity, Resource.String.noconnectionshort, ToastLength.Short).Show();
                    }
                }
                else
                {
                    if (e.IsChecked && !adpt._readonly)
                    {
                        view.FindViewById <ToggleButton>(Resource.Id.chip).SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.baseline_check_white_24, 0);
                    }
                    else
                    {
                        view.FindViewById <ToggleButton>(Resource.Id.chip).SetCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
                    }
                    adpt.FireFilterUpdate(currentitem);
                }
            }
 private void OnCheckChanged(object sender, CheckedChangeEventArgs e)
 => Element.IsChecked = e.IsChecked;
Exemplo n.º 11
0
 private void ItemHolderRadioButton_CheckedChange(object sender, CheckedChangeEventArgs e)
 {
     Checked = e.IsChecked;
     SetDrawable();
 }
 private void OnCheckedChanged(CheckedChangeEventArgs e)
 {
     CheckedChanged?.Invoke(this, e);
 }