WPF button with image error

This forum is meant for anything you would like to share with other visitors
Post Reply
Juraj
Posts: 161
Joined: Mon Jan 09, 2017 7:00 am

WPF button with image error

Post by Juraj »

Hi,
this code works correctly in C#, in X# not working. Error message in attachment
I use VS Community 2017 15.3.4

<Grid.Resources>
<ImageBrush x:Key="Klienti" ImageSource="Klienti.png" Stretch="UniformToFill"/>
</Grid.Resources>
<Button Name="PBKL" Content="Klienti" Width="100" Height="100" HorizontalAlignment="Left" Margin="50,172,0,0" VerticalAlignment="Top"
Background="{StaticResource Klienti}" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Left" FontSize="16" FontWeight="Bold" Foreground="Blue">
</Button>

Juraj
Attachments
XSWPFError.png
XSWPFError.png (160.41 KiB) Viewed 256 times
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

WPF button with image error

Post by NickFriend »

Hi Juraj,

The error refers to "klienti.png", your markup has "Klienti.png". So it looks like either the markup is wrong or for some reason it's being converted internally to lowercase.

Nick
Post Reply