Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
New instance every time using NavigationPage Xamarin Forms?
Fabio Silva Lima
Dec 2 2016 5:00 AM
296
Reply
Let's say i have 3 Xaml views and i use a MasterDetailPage and NavigationPage to navigate back and forward to those pages. Page A -> Page B -> Page C -> ...
I use PushAsync to perform the navigation. No big deal...
I implemment that in two ways:
1 - Create a new instance of those views every time on navigation:
await Navigation.PushAsync(
new
Views.PageA());
2 - Create a static property (at App view) for each page and i use that for navigation:
public
static
Views.PageA PageA
{
get
{
if
(_pageA ==
null
)
{
_pageA =
new
Views.PageA();
}
return
_pageA =;
}
}
await Navigation.PushAsync(App.PageA);
Is there another way to do that? Use static or new instance every time?
My concern it's about performance and memmory usage.
Please let's your answear with your opinion and some code will be apreciated.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
How to build mobile apps from VS2017 using ionic
Few questions about apache cordova and ionic