Datepicker - disabled foreground color Windows Phone 8.1 RT -


how set foreground of datepicker disabled state?

i have try set style res:

<solidcolorbrush x:key="datepickerforegroundthemebrush" color="#444444" />

and:

dpdate.isenabled = false; dpdate.foreground = new solidcolorbrush(colors.black);

but still transparent.

you need modify template of datepicker control in order change it's behavior when in disabled visual state; actually, there button inside datepicker , need change behavior of button.

  1. in designer, right click on datepicker , select edit template -> edit copy -> ok. designer has generated style control.
  2. perform step 1 again generate style button inside date picker.
  3. go xaml view. there 2 style elements under page.resources element: buttonstyle1 , datepickerstyle1. find , comment following part:

xaml:

<visualstate x:name="disabled">     <storyboard>         <objectanimationusingkeyframes storyboard.targetproperty="foreground"                                        storyboard.targetname="contentpresenter">             <discreteobjectkeyframe keytime="0"                                     value="{themeresource buttondisabledforegroundthemebrush}" />         </objectanimationusingkeyframes>         <objectanimationusingkeyframes storyboard.targetproperty="borderbrush"                                        storyboard.targetname="border">             <discreteobjectkeyframe keytime="0"                                     value="{themeresource buttondisabledborderthemebrush}" />         </objectanimationusingkeyframes>         <objectanimationusingkeyframes storyboard.targetproperty="background"                                        storyboard.targetname="border">             <discreteobjectkeyframe keytime="0"                                     value="{themeresource buttondisabledbackgroundthemebrush}" />         </objectanimationusingkeyframes>     </storyboard> </visualstate> 

for more explained example on customizing control templates, checkout quickstart: control templates (xaml).


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -