Exemplo n.º 1
0
 /// <summary>
 /// Default handler for saving or deleting of a child details view.
 /// </summary>
 /// <param name="childViewModel">Child view model that fired the original event</param>
 /// <param name="e">Event object</param>
 protected override void OnChildEvent(object childViewModel, ViewEvent e)
 {
     // ignore events from grandchildren
     if (e.IsSaved() || e.IsDeleted())
     {
         LoadData(); // reload child lists if a child was updated
     }
     base.OnChildEvent(childViewModel, e);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Handles child closing or change to refresh the list.
        /// </summary>
        /// <param name="childViewModel">Child view model that fired the original event</param>
        /// <param name="e">Event object</param>
        /// <param name="token">Cancellation token.</param>
        protected override async Task OnChildEventAsync(object childViewModel, ViewEvent e, CancellationToken token = default)
        {
            UpdateDetailsSelection(childViewModel as DetailsViewModel, e);
            if (e.IsSaved(false) || e.IsDeleted(false))
            {
                await SearchAsync(true, token);
            }

            await base.OnChildEventAsync(childViewModel, e, token);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles child closing or change to refresh the list.
        /// </summary>
        /// <param name="childViewModel">Child view model that fired the original event</param>
        /// <param name="e">Event object</param>
        protected override void OnChildEvent(object childViewModel, ViewEvent e)
        {
            UpdateDetailsSelection(childViewModel as DetailsViewModel, e);
            if (e.IsSaved(false) || e.IsDeleted(false))
            {
                Search(true);
            }

            base.OnChildEvent(childViewModel, e);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles child closing or change to refresh the list.
        /// </summary>
        /// <param name="childViewModel">Child view model that fired the original event</param>
        /// <param name="e">Event object</param>
        protected override void OnChildEvent(object childViewModel, ViewEvent e)
        {
            if (e.IsClosed() && List != null)
            {
                List.ClearSelectedRows();
                List.FireCollectionChanged();
            }
            if (e.IsSaved() || e.IsDeleted())
            {
                Search(true);
            }

            base.OnChildEvent(childViewModel, e);
        }