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

finding an element on the current page?

$
0
0

I'm just trying to locate a named item (in this case it is an "entry" so that I can modify it) within the user's current-page. FWIW, for clarity I named the stackLayout it is contained in as well.

I used this code to track down the page (seems overtly cumbersome..but ok):
actionPage = Application.Current.MainPage;
if (actionPage.Navigation != null)
actionPage = actionPage.Navigation.NavigationStack.FirstOrDefault(); // .NavigationStack.Last();

I get null for the 'actionPage'.
Now, I'm noticing that the current page for the user in some cases is a "tabbed page". Maybe I need to trace through those in those cases as well, but again this is quite a bit of code to do something that seems extremely simple.

I'm going through the xamarin course, so I'm sure I'll get more help there but need to solve this issue very soon. Please help me.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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