Exemplo n.º 1
0
        private async Task GetOwnerAndUpdateGridAsync(OwnerDataModel selectedDirtyOwner, bool isBusyIndicatorOn)
        {
            try
            {
                if (!isBusyIndicatorOn)
                {
                    BusyIndicator.BlockUI();
                }

                if (selectedDirtyOwner == null || selectedDirtyOwner.IdOwner == null)
                {
                    await InitializeAsync(true);

                    throw new ArgumentNullException();
                }

                OwnerDataModel resultOwner = await GetOwnerAsync(selectedDirtyOwner.IdOwner, isBusyIndicatorOn);

                if (resultOwner != null)
                {
                    int indexOfOwner = Owners.IndexOf(selectedDirtyOwner);
                    SelectedOwner.IsDirty = false;
                    Owners.RemoveAt(indexOfOwner);
                    Owners.Insert(indexOfOwner, resultOwner);
                }
            }
            finally
            {
                if (!isBusyIndicatorOn)
                {
                    BusyIndicator.UnblockUI();
                }
            }
        }
Exemplo n.º 2
0
 void HandleOwnerEvent(object sender, EventArgs args)
 {
     if (handler != null)
     {
         var index             = Owners.IndexOf((T)sender);
         var replacementSender = replacementSenders[index] ?? sender;
         handler(replacementSender, args);
     }
 }