private void Button_Click(object sender, RoutedEventArgs e) { MyClassProperty = new MyClass { Name = "lold" }; DetailWindow win = new DetailWindow(); win.grid.Resources["MainWindowResource"] = this; win.ShowDialog(); }