Access WPF Name properties in static method

Viewed 3835

I have a WPF application. In one of the XAML I have used Name attribute like as follows

 x:Name="switchcontrol"

I have to access the control/property in .cs file using this.switchcontrol My question is, I need to access the control in static method like

public static getControl()
{
 var control = this.switchcontrol;//some thing like that
}

How to achieve this?

2 Answers
Related