Example #1
0
 public void ShowPopup(string message, string highlightedMessage, string endMessage, Framework.Xaml.ActionForm.ActionSheetVM actionSheet, bool enableMasterContent = false, bool gobackPreviousView = false)
 {
     PopupActionSheet     = actionSheet;
     ShowPopupActionSheet = true;
     EnableMasterContent  = enableMasterContent;
     PopupOption          = Framework.Xaml.PopupOptions.RegularPopup;
     Message            = message;
     HighlightedMessage = highlightedMessage;
     EndMessage         = endMessage;
     GobackPreviousView = gobackPreviousView;
 }
Example #2
0
        public void ShowYesNoConfirmationPopup(ICommand yesCommand, object yesCommandParameter, string message, string highlightedMessage, string endMessage)
        {
            var list = new List <Framework.Xaml.ActionForm.ActionItemModel>();

            YesActionItemModel.Command          = yesCommand;
            YesActionItemModel.CommandParameter = yesCommandParameter;
            list.Add(YesActionItemModel);
            list.Add(NoActionItemModel);
            var actionSheet = new Framework.Xaml.ActionForm.ActionSheetVM {
                HasIcon = false, ActionItems = new ObservableCollection <Framework.Xaml.ActionForm.ActionItemModel>(list)
            };

            ShowPopup(message, highlightedMessage, endMessage, actionSheet);
        }
Example #3
0
            public static void Show_InlineActionSheet <TItem>(object inlineActionSheetTrigger, EventArgs e, Framework.Xamariner.Controls.ActionForm.InlineActionSheet inlineActionSheet, Func <TItem, Framework.Xaml.ActionForm.ActionSheetVM> getInlineActionSheet)

            {
                if (previousUri != Shell.Current.CurrentState.Location || wrapper == null)
                // 1. Navigated to another Uri, will clear all
                {
                    wrapper = (Layout <View>)inlineActionSheet.Parent;
                    Reset();
                }

                if (previousInlineActionSheetTrigger != inlineActionSheetTrigger && NavigationVM.PopupVM.PopupOption == Framework.Xaml.PopupOptions.InlineActionSheet)
                // 1. Clicked another trigger, close InlineActionSheet first, then Open again in step#3
                {
                    Elmah.XamarinForms.ViewModels.NavigationVM.PopupVM.HidePopup();

                    var previousParent = ((Layout <View>)inlineActionSheet.Parent);
                    previousParent.Children.Remove(inlineActionSheet);
                }
                else if (Elmah.XamarinForms.ViewModels.NavigationVM.PopupVM.PopupOption == Framework.Xaml.PopupOptions.InlineActionSheet)
                // 2. Clicked this trigger again to close InlineActionSheet
                {
                    Elmah.XamarinForms.ViewModels.NavigationVM.PopupVM.HidePopup();

                    var previousParent = ((Layout <View>)inlineActionSheet.Parent);
                    previousParent.Children.Remove(inlineActionSheet);

                    wrapper.Children.Add(inlineActionSheet);
                    return;
                }

                // 3. Show InlineActionSheet
                previousInlineActionSheetTrigger = inlineActionSheetTrigger;

                // Add to new Parent Layout
                var inlinPopupParent = (Grid)((View)inlineActionSheetTrigger).Parent; // Grid, may changed if use button

                inlinPopupParent.Children.Add(inlineActionSheet);

                var navigationVM = DependencyService.Resolve <Elmah.MVVMLightViewModels.NavigationVM>();
                var item         = (TItem)((View)inlineActionSheetTrigger).BindingContext;

                Framework.Xaml.ActionForm.ActionSheetVM actionFormVM = getInlineActionSheet(item);
                Elmah.XamarinForms.ViewModels.NavigationVM.PopupVM.ShowInlineActionSheet(actionFormVM);
            }
Example #4
0
 public void ShowBuiltInPopup(BuiltInPopupTypes type, string message, string highlightedMessage, string endMessage, ICommand command, bool enableMasterContent = false, bool gobackPreviousView = false)
 {
     Framework.Xaml.ActionForm.ActionSheetVM actionSheet;
     if (type == Framework.Xaml.BuiltInPopupTypes.SaveConfirmation)
     {
         actionSheet = GetSavePopupActionSheetVM(command);
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.DeleteConfirmation)
     {
         actionSheet = GetDeletePopupActionSheetVM(command);
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.EnableConfirmation)
     {
         actionSheet = GetEnableConfirmationPopupActionSheetVM(command);
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.DisableConfirmation)
     {
         actionSheet = GetDisableConfirmationPopupActionSheetVM(command);
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.Confirmation)
     {
         actionSheet = GetConfirmationPopupActionSheetVM(command);
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.ClosePopup)
     {
         actionSheet = GetClosePopupActionSheetVM();
     }
     else if (type == Framework.Xaml.BuiltInPopupTypes.CloseItemControlPopup)
     {
         actionSheet = GetCloseItemControlPopupActionSheetVM();
     }
     else
     {
         actionSheet = new Framework.Xaml.ActionForm.ActionSheetVM {
         }
     };
     ShowPopup(message, highlightedMessage, endMessage, actionSheet, enableMasterContent, gobackPreviousView);
 }
Example #5
0
 public void ShowVerticalActionSheet(Framework.Xaml.ActionForm.ActionSheetVM actionSheetVM)
 {
     EnableMasterContent = false;
     ActionSheetVM       = actionSheetVM;
     PopupOption         = PopupOptions.VerticalActionSheet;
 }
Example #6
0
 public void ShowInlineActionSheet(Framework.Xaml.ActionForm.ActionSheetVM actionSheetVM)
 {
     EnableMasterContent = true;
     ActionSheetVM       = actionSheetVM;
     PopupOption         = PopupOptions.InlineActionSheet;
 }
Example #7
0
 public void ShowItemActions(Framework.Xaml.NavigationActionTypes closeAction = NavigationActionTypes.CloseButtonCloseItemControlPopup, Framework.Xaml.ActionForm.ActionSheetVM footerActionSheet = null)
 {
     ListFooterActionSheet = ListFooterActionSheet;
 }
Example #8
0
 public void ShowListSelectionActions()
 {
     ListFooterActionSheet = ListFooterActionSheet;
 }
Example #9
0
 public void ShowGeneralListActions(Framework.Xaml.ActionForm.ActionSheetVM footerActionSheet)
 {
     ListFooterActionSheet = footerActionSheet;
 }