UdaraAlwis / XFColorPickerControl

An interactive and responsive Color Picker Control for Xamarin.Forms based on SkiaSharp!
GNU General Public License v3.0
27 stars 10 forks source link

Binding not working (setter) #2

Closed Suplanus closed 4 years ago

Suplanus commented 4 years ago

Great control!

But the binding is not working

    public ThemePage()
    {
      InitializeComponent();

      ViewModel = new ThemePageViewModel();
      BindingContext = ViewModel;
    }

//...

  [AddINotifyPropertyChangedInterface] // From Fody
  public class ThemePageViewModel
  {
    public Color SelectedColor
    {
      get
      {
        var color = (Color)Application.Current.Resources["HighlightColor"];
        return color;
      }
      set
      {
        Application.Current.Resources["HighlightColor"] = value;
      }
    }
  }
            <xfColorPickerControl:ColorPicker
                x:Name="ColorPicker"
                ColorFlowDirection="Horizontal"
                ColorSpectrumStyle="ShadeToHueToTintStyle"
                HeightRequest="200"
                HorizontalOptions="FillAndExpand"
                PickedColor="{Binding SelectedColor}"
                PickedColorChanged="ColorPicker_OnPickedColorChanged"
                PointerRingBorderUnits="0.3"
                PointerRingDiameterUnits="0.7"
                PointerRingPositionXUnits="0.6"
                PointerRingPositionYUnits="0.6" />
UdaraAlwis commented 4 years ago

Hello there,

This feature is not supported right now due to the complications of the implementation. This property, PickedColor is only available as a Getter: https://github.com/UdaraAlwis/XFColorPickerControl#colorpicked Please refer to the documentation for any further clarification.

However, if you can implement the Setter feature for the ColorPicked property, I'm willing to welcome your Pull Request. Cheers! :)