Example #1
0
 private async void Share_Clicked(object sender, System.EventArgs e)
 {
     if (DoOnce())
     {
         var page = new SharePage(_vm.CipherId);
         await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
     }
 }
Example #2
0
        private async void More_Clicked(object sender, System.EventArgs e)
        {
            if (!DoOnce())
            {
                return;
            }

            var options = new List <string> {
                AppResources.Attachments
            };

            if (_vm.Cipher.OrganizationId == null)
            {
                options.Add(AppResources.Clone);
                options.Add(AppResources.MoveToOrganization);
            }
            else
            {
                options.Add(AppResources.Collections);
            }

            var selection = await DisplayActionSheet(AppResources.Options, AppResources.Cancel,
                                                     AppResources.Delete, options.ToArray());

            if (!await _vm.PromptPasswordAsync())
            {
                return;
            }

            if (selection == AppResources.Delete)
            {
                if (await _vm.DeleteAsync())
                {
                    await Navigation.PopModalAsync();
                }
            }
            else if (selection == AppResources.Attachments)
            {
                var page = new AttachmentsPage(_vm.CipherId);
                await Navigation.PushModalAsync(new NavigationPage(page));
            }
            else if (selection == AppResources.Collections)
            {
                var page = new CollectionsPage(_vm.CipherId);
                await Navigation.PushModalAsync(new NavigationPage(page));
            }
            else if (selection == AppResources.MoveToOrganization)
            {
                var page = new SharePage(_vm.CipherId);
                await Navigation.PushModalAsync(new NavigationPage(page));
            }
            else if (selection == AppResources.Clone)
            {
                var page = new AddEditPage(_vm.CipherId, cloneMode: true, viewPage: this);
                await Navigation.PushModalAsync(new NavigationPage(page));
            }
        }
Example #3
0
 private async void Share_Clicked(object sender, System.EventArgs e)
 {
     if (DoOnce())
     {
         if (!await _vm.PromptPasswordAsync())
         {
             return;
         }
         var page = new SharePage(_vm.CipherId);
         await Navigation.PushModalAsync(new NavigationPage(page));
     }
 }
Example #4
0
        private async void More_Clicked(object sender, System.EventArgs e)
        {
            if (!DoOnce())
            {
                return;
            }
            var options = new List <string> {
                AppResources.Attachments
            };

            if (_vm.EditMode)
            {
                options.Add(_vm.Cipher.OrganizationId == null ? AppResources.MoveToOrganization : AppResources.Collections);
            }
            var selection = await DisplayActionSheet(AppResources.Options, AppResources.Cancel,
                                                     (_vm.EditMode && !_vm.CloneMode)?AppResources.Delete : null, options.ToArray());

            if (selection == AppResources.Delete)
            {
                if (await _vm.DeleteAsync())
                {
                    await Navigation.PopModalAsync();
                }
            }
            else if (selection == AppResources.Attachments)
            {
                var page = new AttachmentsPage(_vm.CipherId);
                await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
            }
            else if (selection == AppResources.Collections)
            {
                var page = new CollectionsPage(_vm.CipherId);
                await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
            }
            else if (selection == AppResources.MoveToOrganization)
            {
                var page = new SharePage(_vm.CipherId);
                await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
            }
        }