Reputation: 743
I want to have two XAML file (Window) having a single code behind file(filename.xaml.cs) in my WPF application.
Upvotes: 3
Views: 1746
Reputation: 564403
A code behind file corresponds to a single root element in XAML, so its not possible to have 2 files share a single code behind file.
That being said, you can often accomplish the underlying goals via other techniques, including:
UserControl
for "child" content, and include the control directly in the main XAML file.Upvotes: 1