Window window = null;
using (FileStream fs = new FileStream("MyWindow.xaml", FileMode.Open, FileAccess.Read))
{
window = (Window)System.Windows.Markup.XamlReader.Load(fs);
}
System.Windows.Controls.Button btnOk = (System.Windows.Controls.Button)window.FindName("btnOk");