How to set custom app bar button icons in windows 8
Asked Answered
A

2

11

I want to set my own customs app bar icons which I downloaded . How can I set that this doesnot work

<AppBarButton x:Name="save" Click="save_Click" Label="Save" Icon="Assets/icon/1.png" />
Allx answered 1/6, 2014 at 20:55 Comment(0)
S
25

Try adding it this way:

<AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">
    <AppBarButton.Icon>
        <BitmapIcon UriSource="ms-appx:///Assets/icon/1.png"/>
    </AppBarButton.Icon>
</AppBarButton>

Check also if the path is correct and that the image is in the correct format to be displayed. You could also give a try using Blend to check if the image is working.

Sanctus answered 1/6, 2014 at 21:0 Comment(3)
I am doing it in this manner but my image is pixelated, I have used images of size mentioned in this answer #28936266Revolute
I think this may be the wrong question to ask about it. Anyhow, what's your image size?Sanctus
see the image in answer of the questionRevolute
A
0

Go back to basics, by creating a button from scratch, and animating it with Blend. I spent days tweaking the code for custom buttons and never got it right. In the end I spent a morning doing the tutorials, and then I was moving ahead. Both of these are very good: Make a Styled Button in XAML for Universal Windows Apps and Custom Styles in XAML - Edit Button Style to Create Your Own Custom Style. The second one is targetted to phone apps, but with some minor changes at the start can be used for desktop – Stephen Hosking 20 secs ago edit

Acrodont answered 23/6, 2017 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.