Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Trying to replace the MainPage, but error

$
0
0

public class myApp: Xamarin.Forms.Application
{
public myApp (Xamarin.Forms.ContentPage pg)
{
MainPage = pg;
}
}

In AppDelegate.cs

var pg = new page_AgentLogin (); // a simple ContentPage

var mainApp = new myApp(pg);

GlobalVar.mainApp = mainApp; // Static Class, Public Static Xamarin.Forms.Application mainApp

LoadApplication(mainApp);

When I trying to replace the MainPage in page_AgentLogin,

var pg = new page_AgentClientList(); // a simple TableView

GlobalVar.mainApp.MainPage = pg;

Error - Could not load type 'UIKit.UIView_UITextField' from assembly 'Xamarin.Forms.Platform.iOS'.
Anyone know what cause this error? When I run the similar code in Android don't have any error.
Or any other better ways to do it? Just want to replace the MainPage of the application so that I can start over again the entire app (it is like reload the app)

Thanks for your time reading this.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>