wpf - How to directy use RenderTransform property of TextBlock -


i understand can rotate text this:

<textblock text="4:00">     <textblock.rendertransform>         <rotatetransform angle="-90"/>     </textblock.rendertransform> </textblock> 

but how can use rendertransform property of textblock directly like:

<textblock text="4:00" rendertransform="<how work?>"/> 

to avoid inner code? maybe general tutorial how works well.

rendertransform property of type transform can mean many possible transform types. can`t assign type has properties using string default. if want to conserve space though, can define rotatetransform in resources, , give key:

<window.resources>     <rotatetransform x:key="myrotatetransform" angle="-90" /> </window.resources> 

then use that:

<textblock text="4:00" rendertransform="{staticresource myrotatetransform}" /> 

this work better if need apply same transform several controls too, because can edit in 1 place.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -