xaml - ApplicationBarIconButton throwing AccessViolationException when i try to make any change -


i have set of applicationbariconbuttons on 1 of xaml page, looks on xaml:

<shell:applicationbariconbutton x:name="button1" iconuri="/images/yourimage.png" text="button 1"/> 

in xaml.cs:

button1.iconuri = new uri("/images/yourimage2.png", urikind.relative); 

when add execute change of iconuri or text, throws accessviolationexception

i wonder what's going on over net, that's way such simple/straightforward change. , image file changed "content", build action "do not copy", i've tried sorts of combination it's still throwing errors. i've recreated whole solution.

but i'm having problem whereby xaml doesn't updated when make change, way me update app on device deleting , reinstalling.

another strange thing that, when run code analysis, i'm getting this:

ca0001 error running code analysis ca0001 : following error encountered while reading module 'xxx': not resolve member reference:  [microsoft.threading.tasks, version=1.0.12.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a]system.threading.tasks.taskex::delay. [errors , warnings] (global) 

you can't access application bar buttons via name.

something should work

  // current application bar   applicationbar thebar = this.applicationbar applicationbar;    // need know index of button in collection , grab   applicationbariconbutton thebutton = thebar.buttons[0] applicationbariconbutton;     //change icon image   thebutton.iconuri = new uri("/images/yourimage2.png", urikind.relative); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -