From 8ec8dc5be9c5ca0d4680ca912f015046e0922b9c Mon Sep 17 00:00:00 2001 From: Branko Zachemsky Date: Mon, 11 Mar 2024 09:49:28 +0100 Subject: [PATCH] DataExchangeViewModel changed --- .../AxoDataExchange/DataExchangeViewModel.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs index 3c39e82b5..912c11872 100644 --- a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs @@ -125,7 +125,7 @@ internal bool IsLockedByMeOrNull() public Task FillObservableRecordsAsync() { //let another thread to load records, we need main thread to show loading symbol in blazor page - return Task.Run(async () => + return Task.Run(() => { IsBusy = true; UpdateObservableRecords(); @@ -218,6 +218,9 @@ public async Task CreateNew() { await FillObservableRecordsAsync(); CreateItemId = null; + + if (StateHasChangedDelegate != null) + StateHasChangedDelegate.Invoke(); } } @@ -238,8 +241,8 @@ public async void Delete() UpdateObservableRecords(); } - StateHasChangedDelegate.Invoke(); - + if (StateHasChangedDelegate != null) + StateHasChangedDelegate.Invoke(); } public async Task Copy() @@ -258,6 +261,9 @@ public async Task Copy() { UpdateObservableRecords(); CreateItemId = null; + + if (StateHasChangedDelegate != null) + StateHasChangedDelegate.Invoke(); } }