Search code examples
dynamicwindows-phoneiconswindows-phone-8.1appbar

Dynamic appbar icon with text


I'm working on a WP8.1 app.

I have a circle in the appbar which is an button icon (transparent png).

Also I have a textbox on the screen of the app. When I enter a number in that text box can i show that number also in the middle of the circle in the appbar as well?

In other words can I have dynamic txt content in a WP8.1 app bar overlaid on top or bottom of a transparent Appbar button icon?


Solution

  • Yes you could have that number in that appbar. First you should get the value entered in the textbox using the Tag property. Then pass value to the Text property of the Appbar using the name you gave:

    sampleAppBar.Text = //the value you get from the textbox
    

    For more refer here:

    Programatically changing the appbar icons

    http://msdn.microsoft.com/library/windows/apps/hh394044(v=vs.105).aspx

    Hope it helps!