Replies: 2 comments 1 reply
-
Hi @mobynet1 if you're able to share a sample project that reproduces this behavior, that's probably the quickest way for us to help. w.r.t the DataContext on MainPage, it will get initially set to ShellViewModel as it's inherited but it should subsequently be set to MainViewModel. There is work being done to address this in a future release (unoplatform/uno.extensions#2451) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have found a solution to my issue... Thanks to all! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am thoroughly confused (ha!, even I admit it! ;-) I have an uno application that has about a dozen pages. I am using the
TabBar
as the navigation method. When the app kicks off, theMainPage
has adata context
set somehow. I know this because of items I am displaying are properly bound sourced from the view model. What confuses me is when I establish aDataContextChanged
event handler and look at the new view for any page,MainPage
included, the new data context is the shell view model. I see no references to any view models in the shell VM. I am using MVVM instead of C# Markup. When I tried out MVUX, I at least saw the BindingXXXViewModel so I knew where I could look for things in that circumstance. I simply cannot find the vm reference.When the app starts up, the initial
MainPage
gets set and any values I am binding from theMainPageViewModel
are properly displayed. I see the initial app being rendered properly, but I used theIsDefault:true
on the route map entry for the main page. I am setting theTabBar
's initial active tab by setting the selected index on theTabBar
object, but this has an odd glitch. The page for this programmatically set first page is blank and only gets set if I navigate to another tab then return to the tab I wanted selected in the first place. But, when I do that, the values I am binding to this new page are getting set in the view model (confirmed via debug), but are not getting bound to any field that references it. Also, I have to navigate to and from the desired page several times to get it to display.Is this a race condition of some sort, or is there something I have missed? I do not know what type of setup you may need to see so tell me what code would be helpful to you and I will provide it.
Beta Was this translation helpful? Give feedback.
All reactions