Not that I know off, If your looking at an MVVM Framework at some stage then Prism makes this really easy and allows you to pass parameters back to the previous page/viewmodel.
@NMackay said:
Not that I know off, If your looking at an MVVM Framework at some stage then Prism makes this really easy and allows you to pass parameters back to the previous page/viewmodel.
I Have two pages (A) and (B),
in a (A) page, i click on a searchBox and send to the page (B) with the value to search,
at my (B) page, load a listView with the searched items,
i want to select a value in the (B) page and confirm,
after this at my (A) page the comboBox will be setted with the value...
Yes, I pass bound objects as parameters via the navigation service to other view models, just look at the parameters dictionary when the VM A is navigated back to and set whatever binding you want.
You can pass the entire view model I guess but that can get pretty heavy.
Yes, I pass bound objects as parameters via the navigation service to other view models, just look at the parameters dictionary when the VM A is navigated back to and set whatever binding you want.
You can pass the entire view model I guess but that can get pretty heavy.
I'm trying to understand some concepts, there's no much time that I work with Xamarin ...
You could also use RX observables aka Reactive UI.
If you are desperate, you could probably extend NavigationPage and write a custom PopAsync method which accepts arguments to pass back to the next page. But, I wouldn't recommend this.
Answers
I think no...
You can use MessagingCenter to send data from B (send) to A (receive)
Otherwise you can pass A's ViewModel to B, modify it so it should result modified after PopAsync
Not that I know off, If your looking at an MVVM Framework at some stage then Prism makes this really easy and allows you to pass parameters back to the previous page/viewmodel.
with Bindings ?
Let me explain better my situation...
I Have two pages (A) and (B),
in a (A) page, i click on a searchBox and send to the page (B) with the value to search,
at my (B) page, load a listView with the searched items,
i want to select a value in the (B) page and confirm,
after this at my (A) page the comboBox will be setted with the value...
Pass A's ViewModel to B
in A's ViewModel should exist a Property in Binding with the ComboBox
B should set to "true" the Property
It should work
@Warwenczack
Yes, I pass bound objects as parameters via the navigation service to other view models, just look at the parameters dictionary when the VM A is navigated back to and set whatever binding you want.
You can pass the entire view model I guess but that can get pretty heavy.
I'm not plugging Prism btw, I just know it makes this kind of scenario really easy and clean to implement.
@NMackay said:
I'm trying to understand some concepts, there's no much time that I work with Xamarin ...
You could also use RX observables aka Reactive UI.
If you are desperate, you could probably extend NavigationPage and write a custom PopAsync method which accepts arguments to pass back to the next page. But, I wouldn't recommend this.
Thanks!