TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Fabio Silva Lima
NA
4.2k
1.2m
New instance every time using NavigationPage Xamarin Forms?
Dec 2 2016 5:00 AM
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.
Reply
Answers (
0
)
How to build mobile apps from VS2017 using ionic
Few questions about apache cordova and ionic