Image on Button?
I'm looking at creating icons on buttons using textures
but I don't want to replace the existing background
is that possible?
My current code snippet, but it replaces the background of the entire button. is there an overlay or a content control that accepts images?
my goal is to replicate this
but I don't want to replace the existing background
is that possible?
My current code snippet, but it replaces the background of the entire button. is there an overlay or a content control that accepts images?
Code: Select all
BottomDock.Children.Add(new Button
{
Content = "test",
Height = BottomStack.Height,
MinWidth = 40,
Background = new Noesis.ImageBrush
{
ImageSource = source,
Stretch = Stretch.Uniform
}
});
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Image on Button?
The Button is a content control, so it provides a Content property you can set with an Image:
Is this what you want?
Code: Select all
BottomDock.Children.Add(new Button
{
Height = BottomStack.Height,
MinWidth = 40,
Content = new Image
{
Source = source,
Stretch = Stretch.Uniform
}
});
Re: Image on Button?
I've tried attaching the image as the content before, I ended up with the name of the texture as text, so I assumed I was doing something wrong.
Thanks!
Thanks!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 18 guests