This is a common problem:
I find an XAML pair on the Internet, one which does exactly what I need. I was able to "Add Existing Item" so both pairs are recognized.
To complicate matters further, the original file's signature looks as customary:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
but the newcomer (rectangleexample) has a different signature:
public partial class RectangleExample : Page
{
public RectangleExample()
{
InitializeComponent();
}
}
I had to comment out the second InitializeComponent()
because it is not found.
Is there a straightforward way (ie, without complicated surgery) to accomplish this?
Update:
I did a full copy (of the newcomer file) on the existent XAML. I removed the old MainWindow pair and renamed the new ones. This is the only remaining problem:
The name InitializeComponent does not exist in the current context
I tried to find a "Add Existent Item", looking for a XAML pair, but such option is not there.
Look for Initialize component trough all the files in the solution, it is defined in a partial class, so you have to rename that class as well.