iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi All,
In one of our scenario of our applicaiton, we need to bind the Category ,Sub Category and Team details with Multiple Picker controls using Form Builder approach.
How to bindmore than one UIPickerviewwith different itemsource.
We have checked the below link and it contains single picker control.
http://git.intersoftpt.com/projects/CROS/repos/samples/browse/FormBuilderSamples/FormBuilderSamples.Core/Models/Reference/Layout/RowDetailLayout.cs
Hi Giridhar,
I need to confirm your scenario:
Hi Arief,
Yes. We need below scenario,
A several single picker bind to each of them (Category, Sub Category, and Team Details) and each of them loaded based on parent data selection.
For Example,
Please let us know, how to pass list itemsource from one view model to another view model?
We have binded more than one pickerview in single page by calling separate view model for each picker view.
Please confirm whether it is right way?
We need to pass the list item source from main view to picker view model. Please let us know how to pass the list/collection from one view model to another view model.
Hi Giridhar,Yes your method is already on point,Here is how to pass value between ViewModel:
First of all, you actually don't need to pass all the list items, you only need to pass the on that user choose, if you are using form you can see that all the value are stored in here:
public class YourFormViewModel: EditorViewModelBase<SearchParameter> { public YourFormViewModel() { // you can access all of your user input in this.Item which can be called anywhere } }
Here is the inside of my SearchParameter (this just an example you don't need to copy exactly like mine)
public class SearchParameter : ModelBase { private Category _category; private SubCategory _subCategory; private TeamDetail _teamDetail public Category Category { get { return _category; } set { if (_category!= value) { _category= value; OnPropertyChanged("Category"); } } } public SubCategory SubCategory { get { return _subCategory; } set { if (_subCategory!= value) { _subCategory= value; OnPropertyChanged("SubCategory"); } } } public TeamDetail TeamDetail { get { return _teamDetail; } set { if (_teamDetail!= value) { _teamDetail= value; OnPropertyChanged("TeamDetail"); } } } }
here is my SubCategorySelectionViewModel:
public class SubCategorySelectionViewModel : ListViewModelBase<Category> { public override async void Navigated(NavigatedParameter parameter) { if (parameter.Sender is SearchFormViewModel){ { YourFormViewModel viewModel = parameter.Sender as YourFormViewModel; //If you use DataListViewModel and query definition you can simply use this //this.ViewQuery = viewModel.Item.Category.Id; //If you use ListViewModel you can use this: //QueryDescriptor queryDescriptor = new QueryDescriptor(); //SelectParameter selectParameter = new SelectParameter(); //selectParameter.QueryDescriptor = queryDescriptor; //var searchResult = await this.SubCategoryRepositort.GetAllAsync(selectParameter); //searchResult = searchResult.where(x => x.Id == viewModel.Item.Category.Id).ToList() } base.Navigated(parameter); //all of this must be done before base! } }
So the passing value actually happening in the parent ViewModel, this way you only need to obtain what customer choose rather all of the list.Hope that will helps!
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname