katonaut
WPF how do I get Uri from a image in a button
HI, how I can get the uri of an image Source in a button in wpf in code behind
Get null at first line
Image image = aud1.Content as Image;
BitmapImage bitmapImage = image.Source as BitmapImage;
if (bitmapImage != null)
{
Uri imageUri = bitmapImage.UriSource;
string uriString = imageUri.ToString();
// Now you have the URI string of the image source
}
3 replies
Starting Code in C# in the main window after clicking a button?
Hi,
when I use
EditWin EditForm = new EditWin();
EditForm.Show();
it open a new window an the code of the window executes
but I would like to run the WPF Code Xaml/cs in the same (MainWindow)
Any help how to do it?
Thank yoou in advance
15 replies