Exemplo n.º 1
0
        /// <summary>
        /// Provides a means of the parent page requesting a navigate from a clicked breadcrumb to the specified group.
        /// </summary>
        /// <remarks>
        /// This doesn't actually navigate, just updates the navViewModel.
        /// </remarks>
        /// <param name="dbViewModel">The DatabaseViewModel to use for the navigation.</param>
        /// <param name="navViewModel">The NavigationViewModel to update.</param>
        /// <param name="clickedGroup">The group to navigate to.</param>
        public override Task RequestBreadcrumbNavigation(IDatabaseViewModel dbViewModel, IDatabaseNavigationViewModel navViewModel, IKeePassGroup clickedGroup)
        {
            navViewModel.SetGroup(clickedGroup);

            // Task.CompletedTask is better here but not available presently.
            return(Task.FromResult(0));
        }
Exemplo n.º 2
0
        public async void RequestDeleteNodeHandler(IDatabaseViewModel vm, IDatabaseNodeViewModel node)
        {
            DebugHelper.Trace($"Delete requested for node {node.Node.Title.ClearValue}");

            MessageDialog dialog = new MessageDialog(
                GetString(DatabaseView.DeletePromptKey),
                GetString(DatabaseView.DeletePromptTitleKey)
                );

            IUICommand yesCommand = new UICommand(GetString("Yes"));
            IUICommand noCommand  = new UICommand(GetString("No"));

            dialog.Commands.Add(yesCommand);
            dialog.Commands.Add(noCommand);

            dialog.DefaultCommandIndex = 0;
            dialog.CancelCommandIndex  = 1;

            IUICommand chosenCommand = await dialog.ShowAsync();

            if (chosenCommand == noCommand)
            {
                // User chose not to delete after all, abort.
                return;
            }

            // Otherwise the user confirmed the delete, so do it.
            ViewModel.DeleteNodeAndSave(node.Node);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Provides a means of the parent page requesting a navigate from a clicked breadcrumb to the specified group.
        /// </summary>
        /// <remarks>
        /// This allows the page to preempt the navigate or do necessary cleanup.
        /// </remarks>
        /// <param name="dbViewModel">The DatabaseViewModel to use for the navigation.</param>
        /// <param name="navViewModel">The NavigationViewModel to update.</param>
        /// <param name="clickedGroup">The group to navigate to.</param>
        public override Task RequestBreadcrumbNavigation(IDatabaseViewModel dbViewModel, IDatabaseNavigationViewModel navViewModel, IKeePassGroup clickedGroup)
        {
            Action navCallback = () =>
            {
                navViewModel.SetGroup(clickedGroup);
            };

            Frame.Navigate(typeof(DatabaseView), new CancellableNavigationParameter(navCallback, dbViewModel));
            return(Task.FromResult <object>(null));
        }
Exemplo n.º 4
0
        public void RequestRenameNodeHandler(IDatabaseViewModel vm, IDatabaseNodeViewModel node)
        {
            DebugHelper.Trace($"Rename requested for node {node.Node.Title.ClearValue}");
            this.nodeBeingRenamed = node;

            TextBox inputBox = RenameFlyout.Content as TextBox;

            DebugHelper.Assert(inputBox != null);

            inputBox.Text = node.Node.Title.ClearValue;
            RenameFlyout.ShowAt(this.childGridView.ContainerFromItem(node) as FrameworkElement);

            inputBox.SelectAll();
        }
Exemplo n.º 5
0
        public void RequestDetailsHandler(IDatabaseViewModel vm, IDatabaseNodeViewModel node)
        {
            DebugHelper.Trace($"Details requested for node {node.Node.Title.ClearValue}");

            if (node.Node is IKeePassEntry entry)
            {
                Frame.Navigate(
                    typeof(EntryDetailsView),
                    ViewModel.GetEntryDetailsViewModel(entry, /* editing */ true)
                    );
            }
            else
            {
                IKeePassGroup group = node.Node as IKeePassGroup;
                DebugHelper.Assert(group != null);
                Frame.Navigate(
                    typeof(GroupDetailsView),
                    ViewModel.GetGroupDetailsViewModel(group, /* editing */ true)
                    );
            }
        }
Exemplo n.º 6
0
 public BacklogViewModel(IDatabaseViewModel Database) : base(Database)
 {
     states = new StateCollectionViewModel(Database, this); Children.Add(states);
 }
Exemplo n.º 7
0
 public TaskCollectionViewModel(IDatabaseViewModel Database, BacklogViewModel Backlog, StateViewModel State) : base(Database)
 {
     this.backlog = Backlog;
     this.state   = State;
 }
Exemplo n.º 8
0
        public TaskViewModel(IDatabaseViewModel Database, BacklogViewModel Backlog) : base(Database)
        {
            StartStopCommand = new ViewModelCommand(OnStartStopCommandCanExecute, OnStartStopCommandExecute);

            this.backlog = Backlog;
        }
Exemplo n.º 9
0
 public BacklogCollectionViewModel(IDatabaseViewModel Database) : base(Database)
 {
 }
Exemplo n.º 10
0
 public SearchViewModel(string query, IDatabaseViewModel databaseViewModel)
 {
     Query = query;
     this.databaseViewModel = databaseViewModel;
 }
Exemplo n.º 11
0
 public OptionViewModel(IDatabaseViewModel Database) : base(Database)
 {
 }
Exemplo n.º 12
0
 public StateCollectionViewModel(IDatabaseViewModel Database, BacklogViewModel Backlog) : base(Database)
 {
     this.backlog = Backlog;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Provides a means of the parent page requesting a navigate from a clicked breadcrumb to the specified group.
 /// </summary>
 /// <remarks>
 /// This allows the page to preempt the navigate or do necessary cleanup.
 /// </remarks>
 /// <param name="dbViewModel">The DatabaseViewModel to use for the navigation.</param>
 /// <param name="navViewModel">The NavigationViewModel to update.</param>
 /// <param name="clickedGroup">The group to navigate to.</param>
 /// <returns>A Task representing the request.</returns>
 public abstract Task RequestBreadcrumbNavigation(IDatabaseViewModel dbViewModel, IDatabaseNavigationViewModel navViewModel, IKeePassGroup clickedGroup);
Exemplo n.º 14
0
        /*public StateCollectionViewModel States
         *      {
         *              get { return backlog.States; }
         *      }*/


        public StateViewModel(IDatabaseViewModel Database, BacklogViewModel Backlog) : base(Database)
        {
            this.backlog = Backlog;
            tasks        = new TaskCollectionViewModel(backlog.Database, backlog, this); Children.Add(tasks);
        }