c# - How to style TextBox headers with multiple colors in Xaml UWP? -
i have lot of textboxes (100's) , want style them such part of textbox color , other in certain.
the above image states need. asterisk red in color.
i have achieved using code
<textbox.header> <textblock > <run >card number</run><run foreground="red">*</run> </textblock> </textbox.header>
but have many textboxes can write style achieve this? content of header dynamic wondering how can this?
alright achieved creating below styling.
<style x:key="mandatorytextbox" targettype="textbox"> <setter property="headertemplate"> <setter.value> <datatemplate> <textblock> <run text="{binding}"></run><run foreground="red">*</run> </textblock> </datatemplate> </setter.value> </setter> </style>
Comments
Post a Comment