Friday, 15 June 2012

xaml - wpf How to set xctk:ColorPicker default color -



xaml - wpf How to set xctk:ColorPicker default color -

edit: managed prepare problem, doing binding value.color instead of binding color, set. help anyway!

i'm making gui has xctk:colorpicker in xaml:

<gridviewcolumn.celltemplate> <datatemplate> <xctk:colorpicker selectedcolor="{binding value.color}" width="40"/> </datatemplate> </gridviewcolumn.celltemplate>

currently, default color of selector blue, alter black. how accomplish this?

the color picker shows default color binded property value

so in case if property value.color homecoming bluish blue

so changing property color black alter black

but in case if not want alter property value create utilize of placeholder property default value of black , update source when changes

example placeholder approach

<grid background="{binding value}"> <xctk:colorpicker selectedcolor="{binding placeholder}" width="40" verticalalignment="center"/> </grid>

view model

class="lang-cs prettyprint-override">bool isdefault = true; public color placeholder { { if (isdefault) homecoming colors.black; homecoming value.color; } set { value.color = value; isdefault = false; } } public solidcolorbrush value { get; set; }

in above illustration assumed value of type solidcolorbrush, , initialized value = new solidcolorbrush(colors.green);

wpf xaml wpftoolkit

No comments:

Post a Comment