wpf - Scaling controls in Silverlight shrinks the control but not the space it occupies -
i'm noticing if use scaletransform on control silverlight, shrinks visible aspects of control, not space occupies (i.e., bounding box).
is there anyway override behavior control and bounding box both shrink when apply scaletransform? or there other way shrink usercontrol? if plain shrink adjusting height/width, lot of details disappear (they don't anti-alias properly).
(note: i'm observing behavior in expression blend, assume applies silverlight/wpf controls in general.)
for sake of context, i'm trying make image button placing usercontrol inside button. i'm transforming usercontrol x = 0.15 & y = 0.15. usercontrol shrinks properly, button looks has massive padding on because usercontrol's bounding box doesn't shrink accordingly. apply scaletransform whole button, it's button has huge bounding box, , creates other problems.
you need use layouttransform
, not rendertransform
. since isn't supported out of box silverlight, can layouttransformer
control silverlight toolkit allow this.
your code so:
<button> <toolkit:layouttransformer> <toolkit:layouttransformer.layouttransform> <scaletransform scalex=".15" scaley=".15"/> </toolkit:layouttransformer.layouttransform> <lcl:myusercontrol /> </toolkit:layouttransformer> </button>
Comments
Post a Comment