I'm creating object in XAML like this
<Window.Resources>
<local:DataReceiver x:Key="request">
</local:DataReceiver>
</Window.Resources>
how can I call this objects method from codebehind?
I'm creating object in XAML like this
<Window.Resources>
<local:DataReceiver x:Key="request">
</local:DataReceiver>
</Window.Resources>
how can I call this objects method from codebehind?
DataReceiver request = this.TryFindResource("request") as DataReceiver;
if (request != null)
{
// your code here
}