Exemple #1
0
            //public ICommand ShowItemBottomUpActionSheetCommand => new Command<Elmah.DataSourceEntities.ElmahType>(OnShowItemBottomUpActionSheetCommand);

            //private void OnShowItemBottomUpActionSheetCommand(Elmah.DataSourceEntities.ElmahType item)
            //{
            //    var selectedActionItemModels = new List<Tuple<Framework.Xaml.StandardRouteRelativeKey, Framework.Xaml.ControlParentOptions>>();
            //
            //    selectedActionItemModels.Add(new Tuple<Framework.Xaml.StandardRouteRelativeKey, Framework.Xaml.ControlParentOptions>(Framework.Xaml.StandardRouteRelativeKey., Framework.Xaml.ControlParentOptions.InPopup));
            //
            //    var actionSheetVM = GetItemActionSheet(item, selectedActionItemModels);
            //
            //    PopupVM.ShowBottomUpActionSheet(actionSheetVM);
            //}

            //public Framework.Xaml.ActionForm.ActionSheetVM GetItemInlineActionSheet(Elmah.DataSourceEntities.ElmahType item)
            //{
            //    var selectedActionItemModels = new List<Tuple<Framework.Xaml.StandardRouteRelativeKey, Framework.Xaml.ControlParentOptions>>();
            //
            //    selectedActionItemModels.Add(new Tuple<Framework.Xaml.StandardRouteRelativeKey, Framework.Xaml.ControlParentOptions>(Framework.Xaml.StandardRouteRelativeKey., Framework.Xaml.ControlParentOptions.InPopup));
            //
            //    return GetItemActionSheet(item, selectedActionItemModels);
            //}

            //public Framework.Xaml.ActionForm.ActionSheetVM GetItemActionSheet(
            //    Elmah.DataSourceEntities.ElmahType item
            //    , List<Tuple<Framework.Xaml.StandardRouteRelativeKey, Framework.Xaml.ControlParentOptions>> selectedList)
            //{
            //    var actionItems = new List<Framework.Xaml.ActionForm.ActionItemModel>();
            //
            //    foreach (var selected in selectedList)
            //        actionItems.Add(GetActionItemModel(item, selected.Item1, selected.Item2));
            //
            //    var actionSheetVM = new Framework.Xaml.ActionForm.ActionSheetVM { HasIcon = true, ActionItems = new ObservableCollection<Framework.Xaml.ActionForm.ActionItemModel>(actionItems) };
            //    return actionSheetVM;
            //}

            /*************************************
            * List of NavigateToCommand *
            *************************************/
            // 1. ItemVM
            #region 1. ItemVM

            // 1.1. NavigateTo Create
            // 1.1.1. NavigateToCommand_Create

            /*
             * public ICommand NavigateToCommand_Create { get; private set; }
             * public async void OnNavigateToCommand_Create(Elmah.DataSourceEntities.ElmahType item)
             * {
             *  PopupVM.HidePopup();
             *
             *  var request = GetLoadDataRequest_NavigateToCommand_Create<Elmah.DataSourceEntities.ElmahType>(item);
             *  DetailsFormActionSheetWhenCreate = GetDetailsFormActionSheetWhenCreate(ItemVM);
             *
             *  MessagingCenter.Send<Elmah.MVVMLightViewModels.ElmahType.ItemVM, Framework.Xaml.LoadItemDataRequest<Elmah.DataSourceEntities.ElmahType>>(
             *      ItemVM, Elmah.MVVMLightViewModels.ElmahType.ItemVM.MessageTitle_AssignItem, request);
             *  await NavigateAsync(DomainKey, Framework.Xaml.StandardRouteRelativeKey.Create.ToString());
             *
             *  //var parameters = new Dictionary<string, string>();
             *
             * //parameters.Add("type", item.Type.ToString());
             *
             *  //await NavigateAsync(DomainKey, Framework.Xaml.StandardRouteRelativeKey.Create.ToString(), parameters);
             * }
             */

            // 1.1.2. ShowPopupCommand_Create

            public override void OnShowPopupCommand_Create(Elmah.DataSourceEntities.ElmahType item)
            {
                PopupVM.HidePopup();

                var request = GetLoadDataRequest_ShowPopupCommand_Create <Elmah.DataSourceEntities.ElmahType>(item);

                DetailsFormActionSheetWhenCreate = GetDetailsFormActionSheetWhenCreate(ItemVM);

                MessagingCenter.Send <Elmah.MVVMLightViewModels.ElmahType.ItemVM, Framework.Xaml.LoadItemDataRequest <Elmah.DataSourceEntities.ElmahType> >(
                    ItemVM, Elmah.MVVMLightViewModels.ElmahType.ItemVM.MessageTitle_AssignItem, request);

                PopupVM.ShowItemControlPopup(Framework.Xaml.StandardRouteRelativeKey.Create.ToString(), true);
            }
Exemple #2
0
            // 1.4. NavigateTo Edit
            // 1.4.1. NavigateToCommand_Edit

            /*
             * public ICommand NavigateToCommand_Edit { get; private set; }
             * public async void OnNavigateToCommand_Edit(Elmah.DataSourceEntities.ElmahType item)
             * {
             *  PopupVM.HidePopup();
             *
             *  var criteria = new Elmah.DataSourceEntities.ElmahTypeIdentifier {
             *      Type = item.Type
             *  };
             *  var request = GetLoadDataRequest_ShowPopupCommand_Details<Elmah.DataSourceEntities.ElmahTypeIdentifier>(criteria);
             *  DetailsFormActionSheetWhenEdit = GetDetailsFormActionSheetWhenEdit(ItemVM);
             *  MessagingCenter.Send<Elmah.MVVMLightViewModels.ElmahType.ItemVM, Framework.Xaml.LoadItemDataRequest<Elmah.DataSourceEntities.ElmahTypeIdentifier>>(
             *      ItemVM, Elmah.MVVMLightViewModels.ElmahType.ItemVM.MessageTitle_LoadItem, request);
             *  await NavigateAsync(DomainKey, Framework.Xaml.StandardRouteRelativeKey.Edit.ToString());
             *
             *  //var parameters = new Dictionary<string, string>();
             *
             * //parameters.Add("type", item.Type.ToString());
             *
             *  //await NavigateAsync(DomainKey, Framework.Xaml.StandardRouteRelativeKey.Edit.ToString(), parameters);
             * }
             */

            // 1.4.2. ShowPopupCommand_Edit
            public override async void OnShowPopupCommand_Edit(Elmah.DataSourceEntities.ElmahType item)
            {
                PopupVM.HidePopup();

                var criteria = new Elmah.DataSourceEntities.ElmahTypeIdentifier {
                    Type = item.Type
                };
                var request = GetLoadDataRequest_ShowPopupCommand_Edit <Elmah.DataSourceEntities.ElmahTypeIdentifier>(criteria);

                DetailsFormActionSheetWhenEdit = GetDetailsFormActionSheetWhenEdit(ItemVM);
                MessagingCenter.Send <Elmah.MVVMLightViewModels.ElmahType.ItemVM, Framework.Xaml.LoadItemDataRequest <Elmah.DataSourceEntities.ElmahTypeIdentifier> >(
                    ItemVM, Elmah.MVVMLightViewModels.ElmahType.ItemVM.MessageTitle_LoadItem, request);
                PopupVM.ShowItemControlPopup(Framework.Xaml.StandardRouteRelativeKey.Edit.ToString(), true);
            }