ColorPickerPalette Binding with my.setting

I need to bind 2 way a the colorpicker palette selected color with an usersetting. I'm working in .net core 3.1.

In xaml I added :

<syncfusion:ColorPickerPalette x:Name="ClrPcker_Background" SelectedBrush="{Binding Source={x:Static p:MySettings.Default}, Path=myBackColor , Mode=TwoWay}" syncfusionskin:SfSkinManager.VisualStyle="Office2019Black" Margin="878,217,273,424" />

and I define myBackground in my.setting, but if I correctly understand SelectedBrush is a system.windows.media item, that I was unable to set as type for myBackground( that I declared as system.drawing.color), is there a way to solve in XAML?


3 Replies

SN Sudharsan Narayanan Syncfusion Team October 4, 2021 03:54 AM UTC

Hi Matteo,

We have checked the reported query that “ColorPickerPalatte binding” from our end. We have prepared the sample to achieve the requirement. Please find the sample from the below location,

Sample: https://www.syncfusion.com/downloads/support/forum/169287/ze/ColorPickerPalette1159267160


Please check the sample and let me known your concerns, If we are misunderstood the query, Please modify the sample and revert to us with reproducible issue. So, it will helpful to prompt the solution on further.

Regards,
 
Sudharsan 



MA Matteo October 11, 2021 07:22 PM UTC

Hello,

I'm sorry that I have not well explained what I mean.

Maybe I should describe the behaveir that I would :

Your example is ok, but what I need is to save the binded value in my.settings as a configuration and at the start of the app get it, so the user haven't to set the color every time it restart the app.



SN Sudharsan Narayanan Syncfusion Team October 13, 2021 03:53 AM UTC

Hi Matteo,

We have checked the reported query that “ColorPickerPalette color change on restart” from our end. We suggest you use the ViewModel to set the permanent color. So, I will apply the color every time you open the application.

If we misunderstood the query, Can you please provide the issue reproducing sample and query you need to achieve.

Regards,
 
Sudharsan

Loader.
Up arrow icon