public Framework.Xaml.ActionForm.ActionParameter GetNavigateToCommandParam_CommonResultView( long oneCondition // can be more , Framework.Xaml.ListItemViewModes listItemViewMode , bool?bindToGroupedResults , string orderByPropertyName , Framework.Queries.QueryOrderDirections?orderByDirection) { return(new Framework.Xaml.ActionForm.ActionParameter { Domain = DomainKey , Page = Framework.Xaml.StandardRouteRelativeKey.CommonResultView.ToString() , SendMessage = () => { SendMessage_Init_CommonResultView(oneCondition, listItemViewMode, bindToGroupedResults, orderByPropertyName, orderByDirection); } }); }
private static void AssignNavigateCommand(GenericListItem typedSender, Framework.Xaml.ListItemViewModes typedNewMode, ICommand command) { if (command != null) { var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Command = command; tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandParameterProperty, "."); if (typedNewMode == Framework.Xaml.ListItemViewModes.SingleSelection || typedNewMode == Framework.Xaml.ListItemViewModes.NavigationWhenRightArrow) { typedSender.RightArrow.IsVisible = true; typedSender.RightArrow.GestureRecognizers.Add(tapGestureRecognizer); } else { typedSender.RightArrow.IsVisible = false; typedSender.GestureRecognizers.Add(tapGestureRecognizer); } } }
/// <summary> /// this method can be called in other view models or anywhere to initialize CommonResultView if referenced in other places. /// </summary> public void SendMessage_Init_CommonResultView( long oneCondition // can be more , Framework.Xaml.ListItemViewModes listItemViewMode , bool?bindToGroupedResults , string orderByPropertyName , Framework.Queries.QueryOrderDirections?orderByDirection) { var vm = DependencyService.Resolve <Elmah.MVVMLightViewModels.ElmahType.IndexVM>(); MessagingCenter.Send <Elmah.MVVMLightViewModels.ElmahType.IndexVM, Framework.Xaml.LoadListDataRequest>(vm, Elmah.MVVMLightViewModels.ElmahType.IndexVM.MessageTitle_LoadData, new Framework.Xaml.LoadListDataRequest { ListItemViewMode = listItemViewMode , BindToGroupedResults = bindToGroupedResults , OrderByPropertyName = orderByPropertyName , OrderByDirection = orderByDirection , Parameters = new Dictionary <string, object> { // { nameof(Elmah.DataSourceEntities.ElmahType.oneCondition), oneCondition }, // { nameof(Elmah.DataSourceEntities.ElmahType.BusinessEntityID), businessEntityID }, // can be more } , ActionWhenLaunch = () => { DefaultItem(oneCondition); ListFooterActionSheet = GetListFooterActionSheet(vm); } }); }
// 03.01. CommonSearchView -> Elmah.XamarinForms.Pages.ElmahType.CommonSearchView /* * public Framework.Xaml.ActionForm.ActionItemModel GetActionItemModel_LaunchCommonSearchView( * long oneCondition // can be more * , Framework.Xaml.ListItemViewModes listItemViewMode * , bool? bindToGroupedResults * , string orderByPropertyName * , Framework.Queries.QueryOrderDirections? orderByDirection) * { * var actionItem = new Framework.Xaml.ActionForm.ActionItemModel * { * ActionFormItemType = Framework.Xaml.ActionForm.ActionFormItemTypes.NavigationItem, //CommandItem, open CommonSearchView * Title = Elmah.Resx.UIStringResourcePerApp.ElmahType, // some localized text here, e.g. Framework.Resx.UIStringResource. or NTierOnTime.Resx.UIStringResourcePerApp, or NTierOnTime.Resx.UIStringResourcePerEntity * FontIconSettings = new Framework.Xaml.FontIconSettings * { * MasterFontIcon = Framework.Xaml.FontAwesomeIcons. // Search, open CommonSearchView * , MasterFontIconFamily = Framework.Xaml.IconFontFamily.FontAwesomeSolid.ToString() * }, * NavigationCommand = NavigationVM.NavigationCommand, * NavigationCommandParam = GetNavigateToCommandParam_CommonSearchView(oneCondition, listItemViewMode, bindToGroupedResults, orderByPropertyName, orderByDirection) * // Command = popupVM.Command_ShowRightSidePopup, for open CommonSearchView * }; * * return actionItem; * } * * public Framework.Xaml.ActionForm.ActionParameter GetNavigateToCommandParam_CommonSearchView( * long oneCondition // can be more * , Framework.Xaml.ListItemViewModes listItemViewMode * , bool? bindToGroupedResults * , string orderByPropertyName * , Framework.Queries.QueryOrderDirections? orderByDirection) * { * return new Framework.Xaml.ActionForm.ActionParameter { * Domain = DomainKey * , Page = Framework.Xaml.StandardRouteRelativeKey.CommonSearchView.ToString() * , SendMessage = () => { * SendMessage_Init_CommonSearchView(oneCondition, listItemViewMode, bindToGroupedResults, orderByPropertyName, orderByDirection); * } * }; * } * * /// <summary> * /// this method can be called in other view models or anywhere to initialize CommonSearchView if referenced in other places. * /// </summary> * public void SendMessage_Init_CommonSearchView( * long oneCondition // can be more * , Framework.Xaml.ListItemViewModes listItemViewMode * , bool? bindToGroupedResults * , string orderByPropertyName * , Framework.Queries.QueryOrderDirections? orderByDirection) * { * var vm = DependencyService.Resolve<Elmah.MVVMLightViewModels.ElmahType.IndexVM>(); * MessagingCenter.Send<Elmah.MVVMLightViewModels.ElmahType.IndexVM, Framework.Xaml.LoadListDataRequest>(vm, Elmah.MVVMLightViewModels.ElmahType.IndexVM.MessageTitle_LoadData, * new Framework.Xaml.LoadListDataRequest * { * ListItemViewMode = listItemViewMode * , BindToGroupedResults = bindToGroupedResults * , OrderByPropertyName = orderByPropertyName * , OrderByDirection = orderByDirection * , Parameters = new Dictionary<string, object> { * { nameof(Elmah.DataSourceEntities.ElmahType.oneCondition), oneCondition }, * // { nameof(Elmah.DataSourceEntities.ElmahType.BusinessEntityID), businessEntityID }, // can be more * } * , ActionWhenLaunch = () => { DefaultItem(oneCondition); ListFooterActionSheet = GetListFooterActionSheet(vm); } * }); * } */ // 03.02. CommonResultView -> Elmah.XamarinForms.Pages.ElmahType.CommonResultView public Framework.Xaml.ActionForm.ActionItemModel GetActionItemModel_LaunchCommonResultView( long oneCondition // can be more , Framework.Xaml.ListItemViewModes listItemViewMode , bool?bindToGroupedResults , string orderByPropertyName , Framework.Queries.QueryOrderDirections?orderByDirection) { var actionItem = new Framework.Xaml.ActionForm.ActionItemModel { ActionFormItemType = Framework.Xaml.ActionForm.ActionFormItemTypes.NavigationItem, //CommandItem, open CommonSearchView Title = Elmah.Resx.UIStringResourcePerApp.ElmahType, // some localized text here, e.g. Framework.Resx.UIStringResource. or NTierOnTime.Resx.UIStringResourcePerApp, or NTierOnTime.Resx.UIStringResourcePerEntity FontIconSettings = new Framework.Xaml.FontIconSettings { MasterFontIcon = Framework.Xaml.FontAwesomeIcons.Question // Search, open CommonSearchView , MasterFontIconFamily = Framework.Xaml.IconFontFamily.FontAwesomeSolid.ToString() }, NavigationCommand = NavigationVM.NavigationCommand, NavigationCommandParam = GetNavigateToCommandParam_CommonResultView(oneCondition, listItemViewMode, bindToGroupedResults, orderByPropertyName, orderByDirection) // Command = popupVM.Command_ShowRightSidePopup, for open CommonSearchView }; return(actionItem); }