D
D
degtevOV2016-02-02 14:06:11
Windows phone
degtevOV, 2016-02-02 14:06:11

How do I fix errors that occur after adding a new Windows Phone 8.1 XAML page?

I add a new XAML page with a right click on the application in the project tree - then click add, then create element and select an empty XAML page. I call let's say HomePage.xaml. The compiler then throws the following errors:

Error CS1061 'App' does not contain a definition for 'InitializeComponent' and could not find an extension method 'InitializeComponent' that takes type 'App' as the first argument (perhaps missing a using directive or an assembly reference).
Error CS1061 'HomePage' does not contain definition for 'InitializeComponent' and could not find an extension method 'InitializeComponent' that takes the type 'HomePage' as the first argument (maybe a using directive or an assembly reference is missing).
Error CS1061 'MainPage' does not contain a definition for 'InitializeComponent' and could not find an extension method 'InitializeComponent' that takes type 'MainPage' as its first argument (maybe missing using directive or assembly reference).
Error CS0103 The name 'Login_Button' does not exist in the current context.
Error CS0103 The name 'Login_Input' does not exist in the current context.
Error CS0103 The name 'Password_Input' does not exist in the current context.

Although the application compiles and continues to work.
The login buttons and inputs are used in the click event as follows:
private async void Login_Button_Click(object sender, RoutedEventArgs e)
{
    Login_Button.IsEnabled = false;

    string login = Login_Input.Text;
    string password = Password_Input.Password;

Please help, what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
degtevOV, 2016-02-03
@degtevOV

It was necessary to restart the visual and rebuild the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question