How to Implement Image Button like Unity style?
Posted: 08 Nov 2021, 15:08
I Create a button with a Background Image, Which is run Success. But When I Press the button, the Image is disappeared.
I try it in Blend, the Image is also disappeared. so it is WPF style.
But How to Implement Image Button like Unity style ? When press the button the image is dark, and when hover the button the image is light?
I try it in Blend, the Image is also disappeared. so it is WPF style.
But How to Implement Image Button like Unity style ? When press the button the image is dark, and when hover the button the image is light?
Code: Select all
<UserControl x:Class="NoesisGUIStudy.NoesisGUIStudyMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<Border Background="DodgerBlue" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="50,20">
<StackPanel x:Name="Container">
<TextBlock Text="Hello World" FontSize="30" Foreground="White"/>
<Button Content="Button" Margin="0,10,0,0">
<Button.Background>
<ImageBrush ImageSource="button.png"/>
</Button.Background>
</Button>
</StackPanel>
</Border>
</UserControl>