Question

i just start developping windows phone apps through using silverlight & windows phone SDK 7.1 frameworks and while i am open a new project for developping an App[lication] bar i noticed that i need a reference [Microsoft.Phone.Shell] well .. i try to add it .. after a multiple of effort of searching i see that i didn't have the .Dll file → [Microsoft.Phone.Shell.dll] in the directory of my installed .Dll files .. so Plz my friends i need an answer or a hint to complete that app ....

Was it helpful?

Solution

What you need to do to be able to use Application Bar are:

  1. Add reference to Microsoft.Phone.dll
  2. Add following two namespaces

    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"

  3. Then you can use the application bar :


<phone:PhoneApplicationPage 
    ...
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    ...
    >
    ...

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True">
            <shell:ApplicationBarIconButton IconUri="/Images/button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/button2.png" Text="Button 2"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top