Blokkolás és frissítés is

This commit is contained in:
Iván Szabó
2025-06-05 08:47:17 +02:00
parent 75d8119880
commit 4c7d71a404
2 changed files with 54 additions and 25 deletions
@@ -198,6 +198,9 @@
Margin="1"
CornerRadius="10"
HasShadow="True">
<RefreshView x:Name="CheckListTemplateRefreshView"
IsRefreshing="{Binding IsRefreshingT}"
Command="{Binding RefreshCommandT}">
<ScrollView>
<VerticalStackLayout>
<Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
@@ -228,6 +231,7 @@
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</RefreshView>
</Frame>
<Grid BackgroundColor="#80000000"
IsVisible="{Binding IsLoading}"
@@ -31,6 +31,7 @@ public partial class CheckListPage : ContentPage
public ICommand InfoCommand { get; set; }
public ICommand CloseCommand { get; set; }
public ICommand RefreshCommand { get; }
public ICommand RefreshCommandT { get; }
public bool IsLoading
{
@@ -52,6 +53,7 @@ public partial class CheckListPage : ContentPage
}
private bool _isRefreshing;
private bool _isRefreshingT;
public bool IsRefreshing
{
get => _isRefreshing;
@@ -64,6 +66,18 @@ public partial class CheckListPage : ContentPage
}
}
}
public bool IsRefreshingT
{
get => _isRefreshingT;
set
{
if (_isRefreshingT != value)
{
_isRefreshingT = value;
OnPropertyChanged(nameof(IsRefreshingT));
}
}
}
public CheckListPage()
{
@@ -79,6 +93,7 @@ public partial class CheckListPage : ContentPage
InfoCommand = new Command<CheckListHeaderDTO>(OnInfoItem);
CloseCommand = new Command<CheckListHeaderDTO>(OnCloseItem);
RefreshCommand = new Command(async () => await OnRefresh());
RefreshCommandT = new Command(async () => await OnRefreshT());
}
private async void OnSyncClicked(object sender, EventArgs e)
@@ -128,6 +143,16 @@ public partial class CheckListPage : ContentPage
IsRefreshing = false;
}
private async Task OnRefreshT()
{
IsRefreshingT = true;
//await _syncService.SyncCheckListHeader_Down((d, s) => { });
await LoadCheckListTemplate();
IsRefreshingT = false;
}
private void SetInfo()
{
_currentUser = _userService.GetCurrentUser();
@@ -384,7 +409,7 @@ public partial class CheckListPage : ContentPage
if (!isAdmin)
{
var result = checkListHeaderDTOs
.Where(w => w.UserId == userDTO.Id && w.CheckStatus != CheckStatus.Blocked).ToList();
.Where(w => w.UserId == userDTO.Id).ToList();
CheckList.ItemsSource = result;
}