Friday, 15 May 2015

wpf - Dynamically change control property based on other controls -



wpf - Dynamically change control property based on other controls -

in wpf, have grid 1 row , 2 columns.

<grid> <textbox grid.column=0> <validation.errortemplate> <dockpanel> <image dockpanel.dock="right" margin="20,0,0,0"/> </dockpanel> </validation.errortemplate> </textbox> <button grid.column=1> </button>

i want image (error icon) remain on right of button, can have variable size depending on text. there way dynamically set margin of image based on width of button? right fixed 20 pixels right of textbox.

validation error template shown in special adorner layer. if need position elements relative adorned element utilize adornedelementplaceholder class in xaml.

wpf xaml wpf-controls

No comments:

Post a Comment