0

I'm trying to create a custom an AppBarButton and an AppBarToggleButton in my Windows app. In the design view in Visual Studio I created a custom style that I applied to my button like so:

<Page.Resources>
    <Style x:Key="NewAppBarStyle" TargetType="AppBarToggleButton">
    (...)
    </Style>
</Page.Resources>

<AppBarToggleButton Icon="Stop" Label="Style" Style="{StaticResource NewAppBarStyle}" />

And in that view everything works fine. However, everytime I check the app in the phone, the result is not what I expected. Here are some pics:

design view phone view

I'm not sure why this happens and it would be a great help if someone could explain me why and how can I in fact create a custom AppBarButton.

Default style for the AppBarButton and AppBarToggleButton.

You can find a project to test this here: http://1drv.ms/1OdhBwX

Schrödinger's Box
  • 3,218
  • 1
  • 30
  • 51
  • when button is selected, appbarbutton is going down. is that ur problem? – madhu kumar Nov 17 '15 at 13:11
  • No, the left image is what I see in the Design View in VS and the result I want, and the right image is what I see in the phone after running the app. The style is not being applied. – Schrödinger's Box Nov 17 '15 at 13:50
  • did u try with find and replace option to replace the old image with new one in the entire solution? it might not be replaced with the new one. – madhu kumar Nov 17 '15 at 14:40
  • I don't think you understood my problem. I'm not just trying to change the picture, that I can already do. What I'm trying to change is the whole data template. As you can see on the left picture I have different colors and a different template for the first secondary command (option w style), when I run the app, it completely ignores the style, as seen on the right. If you check the project you'll understand what I'm saying. – Schrödinger's Box Nov 17 '15 at 14:59

0 Answers0