Get Compilation error
“Error CS1061: ‘…Page…’ does not contain a definition for ‘InitializeComponent’ and no accessible extension method ‘InitializeComponent’ accepting a first argument of type ‘…Page …’ could be found (are you missing a using directive or an assembly reference?)”
The line this.InitializeComponent();
is marked with a red line.
See my own answer.
If you have copied a page (.XAML) into your project with ‘Add’.’Existing Item…’, the property ‘Build Action’ for the .XAML file is probably set to ‘None’, it should be ‘Page’.