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 Domingo.
To implement searching, you need to provide a custom view controller for the selection list.
[ImportBinding(typeof(CategoryListBindingProvider))][RegisterNavigation(DeviceKind.Phone)][Register("CategoryListViewController")]public partial class CategoryListViewContoller : UITableViewController<CategoryListViewModel> { public CategoryListViewContoller() : base("CategoryListView", null) { } protected override void InitializeView() { base.InitializeView(); this.RegisterViewIdentifier("SearchTableView", this.SearchDisplayController.SearchResultsTableView); } public override bool AllowSearching { get { return true; } } public override ChoiceInputMode ChoiceInputMode { get { return ChoiceInputMode.Single; } } public override TableViewInteraction InteractionMode { get { return TableViewInteraction.ChoiceInput; } } }
And don't forget to specify some properties for SelectionInput attribute in your form metadata, such as ReuseExistingViewContext and NavigationTargetIdentifier. It will ensure the form builder to use your view controller, instead the default one.
[SelectionInput(SelectionMode.Single, DisplayMemberPath = "Name", ListSourceType = typeof(CategoryListViewModel), ReuseExistingViewContext = true, NavigationTargetIdentifier="CategoryListViewController")] public static string Category;
Hope this helps. You also can get the sample for this scenario from here: http://git.intersoftpt.com/projects/CROS-SUPP/repos/enable-searching-in-selection-form/browse.
Feel free to discuss it further if you have any other thought.
Kind Regards,
If you want to bind the same view model on multiple views, you need to register the name for each view, differentiating it from the other views. Later, the name will be used as the navigation target. See the following code.
// For iOS[RegisterNavigation("FirstTab")] public partial class FirstViewController : UIViewController<SharedViewModel> { }// For Android[RegisterNavigation("FirstTab")]public class FirstFragment : Fragment<SharedViewModel>{}// For WinPhone[ViewModelType(typeof(SharedViewModel))][RegisterNavigation("FirstTab")]public partial class FirstTab : PhoneApplicationPage{}// For WinRT[ViewModelType(typeof(SharedViewModel))][RegisterNavigation("FirstTab")]public sealed partial class FirstTab : LayoutAwarePage{}
Then while initializing the tab items on your parent's view model, you need to specify the navigation target, which contains the child's view model type and the target name. See the following code.
public class TabViewModel : MultiPageViewModelBase { public TabViewModel() { var items = new List<NavigationItem>(); items.Add(new NavigationItem("First Tab", new NavigationTarget(typeof(SharedViewModel), "FirstTab"))); items.Add(new NavigationItem("Second Tab", new NavigationTarget(typeof(SharedViewModel), "SecondTab"))); items.Add(new NavigationItem("Third Tab", new NavigationTarget(typeof(SharedViewModel), "ThirdTab"))); this.Items = items.ToArray(); } }
Hope this helps. I also attached a sample solution for this scenario.
Jack
public class TabViewModel : MultiPageViewModelBase{ public TabViewModel() { var parameter1 = "Simple Page"; var parameter2 = "About Page"; var items = new List<NavigationItem>(); items.Add(new NavigationItem("Simple Page", new NavigationTarget(typeof(SimpleViewModel), new NavigationParameter(parameter1)))); items.Add(new NavigationItem("About", new NavigationTarget(typeof(AboutNavigationViewModel), new NavigationParameter(parameter2)))); this.Items = items.ToArray(); }}
2. The second technique is the dynamic one. You can perform any logic based on your scenario to provide the parameter and pass it to the child's view model. Simply, you only need to override the ShouldNavigate method from the parent's view model. See the following code.
public class TabViewModel : MultiPageViewModelBase { public override bool ShouldNavigate(NavigationTarget target) { // Perform your own logic here if (target.Type == typeof(SimpleViewModel)) target.Parameter.Data = this.Data1; else target.Parameter.Data = this.Data2; return base.ShouldNavigate(target); } }
Hope this helps. Feel free to discuss it further if you have any other thought.
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