Tuğçe Arar
Tuğçe Arar

Apr 2, 2021

·
1 min read
by F-Kroll

Xamarin Tips: Convert string to a Page in Xamarin.Forms

You can open your pages dynamically in your Xamarin.Forms application. For that we can use Type.GetType(string):

async Task OpenPage(object obj)
{
var pageType= Type.GetType($"NamespaceOfYourView.{obj}");
var page = Activator.CreateInstance(pageType) as Page;
await Application.Current.MainPage.Navigation.PushAsync(page );
}

You can read details of Type.GetType in here.

Xamarin Forms
Xamarin
Dotnet

--

--

More from Tuğçe Arar

iOS Developer

Recommended from Medium

Dhaivat Joshi

Dhaivat Joshi

The reason that angular js developers still have a demand in 2023

Code With Travel

Code With Travel

How to implement Node.js Rest Apis with Express, Sequelize pagination & MySQL

Hrishikesh Mane

Hrishikesh Mane

Firebase hooks, my new best friend.

Görkem İşler

Görkem İşler

Selenium WebForm Interactions

Josef Cruz

Josef Cruz

in

JavaScript in Plain English

What Makes a Good Software Builder and What Makes a Lousy One

Fadi Tillman

Fadi Tillman

Palindrome Number LeetCode Cheat Sheet Javascript Solution

Derek Fong

Derek Fong

in

We’ve moved to freeCodeCamp.org/news

How to build an Apollo GraphQL server with TypeScript and Webpack Hot Module Replacement

Rohit Kshirsagar

Rohit Kshirsagar

JS - What is difference between Call, Apply and Bind

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Get unlimited access
Tuğçe Arar

Tuğçe Arar

236 Followers

iOS Developer

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech