문제

im developing a metro app for windows 8 and I have big difficulties to change icon in BottomAppBar in code. I want to have there icon which indicates that sounds are enabled and when you tap it I want it to change to another icon which indicates that sounds are disabled

<Button x:Name="SoundsAppBarIcon" 
Style="{StaticResource SoundsEnabledAppBarButtonStyle}"
Tag="Sounds"
Click="SoundsAppBarIcon_Click"/>

In that style there is <Setter Property="Content" Value="&#xE189;"/> and I dont know what this &#xE189 mean.

Anyway I tried to do something like this but it didnt work either

<Button x:Name="SoundsAppBarIcon" 
        Tag="Sounds"
        Click="SoundsAppBarIcon_Click">
    <Button.Content>
        <Image Source="Assets/Images/SoundsDisabled.png"/>
    </Button.Content>
</Button>

Thank you for your help

도움이 되었습니까?

해결책

& #xE189; is the character code.

You can get more icons by opening Character Map, selecting "Segoe UI Symbol" for the font, and then scrolling down to find one you like. Microsoft recommends using these icons, rather than image files, for uniformity amongst apps.

Once you find an icon you like from the Character Map, simply copy it and paste it into your content setter in the XAML. Don't worry about it appearing as a box with a question mark in it within the code, it will display correctly within the app.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top