MahApps Metro Tile Icon not showing

3.1k Views Asked by At

Currently i am designing WPF application using MahApps.Metro style UI. Tile control which provided by MahApps can not showing icon in center of tile

I saw example in MahApps website where it could show image as tile background, but I couldn't figure out how to show icon instead of image (icon such as IE logo, people logo, maps logo, etc)

I appreciated if someone can show me how to do this

Thank you

2

There are 2 best solutions below

0
Jedifuk On

i figure it out

use icons.xaml as resource, and add rectangle control inside tile, here is the example on how to show character inside tile control

<Controls:Tile x:Name="mahTileExit"  Background="Green"   Foreground="Yellow"   Title="Exit" Width="100" Height="100" TiltFactor ="4" Margin="936,404,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <Rectangle Fill="White" Height="45" Width="45">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{StaticResource appbar_door_leave}" Stretch="Fill" />
                    </Rectangle.OpacityMask>
                </Rectangle>
        </Controls:Tile>

thank you if anyone notice about this, hope can help to contribute

0
Morlo Mbakop On

You can use FontAwesome.Wpf which has more icons and requires less code.

<Controls:Tile Width="300" Height="150" Grid.Column="0" Grid.Row="1" Title="Hello!">
    <Grid Width="50" Height="50">
        <fa:ImageAwesome Icon="Flag" Foreground="#FFFFFF"/>
    </Grid>
</Controls:Tile>

Don't forget to call the namespace

xmlns:fa="http://schemas.fontawesome.io/icons/"