Tuesday 15 February 2011

No Property of name Image found for Button on Windows Phone -



No Property of name Image found for Button on Windows Phone -

i'm getting issue don't understand. have button image defined next code :

<button image="searchfiltericon.png" grid.row="0" grid.column="1" clicked="onbuttonfilterclicked" />

this works on android. image displayed on button when launch windows phone application, xamlparseexception says : no property of name image found.

how possible? button widget isn't same on android , windows phone?

if following:-

button objbutton1 = new button(); objbutton1.image = (fileimagesource)imagesource.fromfile("testimage1.png"); objstacklayout.children.add(objbutton1); this.content = objstacklayout;

then work (via code-behind).

the button command had image property, in xamarin.forms v1.2.2x, is not new property introduced , nil having latest packages installed.

as workaround perhaps should consider giving xaml button x:name in:-

<button x:name="mybutton1"/>

and assign image code-behind:-

mybutton1.image = (fileimagesource)imagesource.fromfile("testimage1.png");

update 1

this case of old libraries beingness used (v1.0.6186). 1 time project reupdated latest binaries v1.2.3x, works fine.

button windows-phone-8 xamarin.forms xamlparseexception

No comments:

Post a Comment