wpf - Using StaticResource to set ListView's Height property throws exception -



wpf - Using StaticResource to set ListView's Height property throws exception -

i define "displayheight" in app.xaml file here:

<application.resources> <sys:int32 x:key="displayheight">534</sys:int32> </application.resources>

i seek set listview height here:

<grid> <listview x:name="mylistview" height="{staticresource displayheight}"/> </grid>

this results in next exception:

{"'534' not valid value property 'height'."}

i don't understand why wouldn't work. can manually set height 534 , works. also, read controls "height" "int32" shouldn't type problem...

height double, need declare such if want utilize staticresource directly.

alternatively wrap in binding uses type converters:

class="lang-xml prettyprint-override">height="{binding source={staticresource displayheight}}"

wpf xaml

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -