Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Get resource key inside the created resource object

$
0
0

I have the following setup. I create a number of objects in XAML as resources, and specify parameters to them, which I then process in code. If something is wrong with the parameters, I want (for debugging purposes) to tell, which object is set up wrongly. For this I'd like to send, along with the exception, the resource key, which identifies this object. Can this be done?

Something like this (VB code):

Throw New ArgumentException("Wrong parameter 1 in object " & SOMETHING_GOES_HERE.ResourceKey)


Mikhail


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>