Click here to Skip to main content
15,885,881 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to Navigate from Page To Page with the click event on my main page but

gives me following error:

Argument 1: cannot convert from 'TESTTwo.Register' to 'Xamarin.Forms.Page'

My Project Named TESTTwo

What I have tried:

My Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace TestTWO
{
public partial class MainPage :ContentPage
{
public MainPage()
{
InitializeComponent();
}

private void Button_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new Register());
}
}
}

My Design


<contentpage xmlns="http://xamarin.com/schemas/2014/forms"
="" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:class="TestTWO.MainPage">
<stacklayout>
<stacklayout>
Posted
Updated 1-Sep-21 22:29pm

1 solution

Your Register class - which you haven't shown - doesn't inherit from Xamarin.Forms.Page. You can't navigate to something that isn't a page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900