Windows Phone ApplicationBar BackgroundColor property style XamlParseException

后端 未结 1 1788
长情又很酷
长情又很酷 2021-01-19 17:49

I had a lot of pages in my application and I had decided to make a global ApplicationBar style in App.Resources:

<         


        
相关标签:
1条回答
  • 2021-01-19 18:31

    I believe, ApplicationBar properties cannot use Binding or styling the way you're trying, as it is not a silverlight control. Although you can put the whole applicationbar as a resource. Like so

    <shell:ApplicationBar x:Key="MyAppBar" IsVisible="True" BackgroundColor="#006699">
             <shell:ApplicationBarIconButton IconUri="/Images/image.png" Text="image"  IsEnabled="True"/>  
    </shell:ApplicationBar>
    

    EDIT: Or you could just put this in the resource if you want your application bar color to change.

    <shell:ApplicationBar x:Key="MyAppBar" IsVisible="True" BackgroundColor="#006699">
    </shell:ApplicationBar>
    

    And add buttons from code behind. although, I haven't come across a scenario where this would help.

    0 讨论(0)
提交回复
热议问题