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" Margin="1"
CornerRadius="10" CornerRadius="10"
HasShadow="True"> HasShadow="True">
<RefreshView x:Name="CheckListTemplateRefreshView"
IsRefreshing="{Binding IsRefreshingT}"
Command="{Binding RefreshCommandT}">
<ScrollView> <ScrollView>
<VerticalStackLayout> <VerticalStackLayout>
<Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" /> <Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
@@ -228,6 +231,7 @@
</CollectionView> </CollectionView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</RefreshView>
</Frame> </Frame>
<Grid BackgroundColor="#80000000" <Grid BackgroundColor="#80000000"
IsVisible="{Binding IsLoading}" IsVisible="{Binding IsLoading}"
@@ -31,6 +31,7 @@ public partial class CheckListPage : ContentPage
public ICommand InfoCommand { get; set; } public ICommand InfoCommand { get; set; }
public ICommand CloseCommand { get; set; } public ICommand CloseCommand { get; set; }
public ICommand RefreshCommand { get; } public ICommand RefreshCommand { get; }
public ICommand RefreshCommandT { get; }
public bool IsLoading public bool IsLoading
{ {
@@ -52,6 +53,7 @@ public partial class CheckListPage : ContentPage
} }
private bool _isRefreshing; private bool _isRefreshing;
private bool _isRefreshingT;
public bool IsRefreshing public bool IsRefreshing
{ {
get => _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() public CheckListPage()
{ {
@@ -79,6 +93,7 @@ public partial class CheckListPage : ContentPage
InfoCommand = new Command<CheckListHeaderDTO>(OnInfoItem); InfoCommand = new Command<CheckListHeaderDTO>(OnInfoItem);
CloseCommand = new Command<CheckListHeaderDTO>(OnCloseItem); CloseCommand = new Command<CheckListHeaderDTO>(OnCloseItem);
RefreshCommand = new Command(async () => await OnRefresh()); RefreshCommand = new Command(async () => await OnRefresh());
RefreshCommandT = new Command(async () => await OnRefreshT());
} }
private async void OnSyncClicked(object sender, EventArgs e) private async void OnSyncClicked(object sender, EventArgs e)
@@ -128,6 +143,16 @@ public partial class CheckListPage : ContentPage
IsRefreshing = false; IsRefreshing = false;
} }
private async Task OnRefreshT()
{
IsRefreshingT = true;
//await _syncService.SyncCheckListHeader_Down((d, s) => { });
await LoadCheckListTemplate();
IsRefreshingT = false;
}
private void SetInfo() private void SetInfo()
{ {
_currentUser = _userService.GetCurrentUser(); _currentUser = _userService.GetCurrentUser();
@@ -384,7 +409,7 @@ public partial class CheckListPage : ContentPage
if (!isAdmin) if (!isAdmin)
{ {
var result = checkListHeaderDTOs var result = checkListHeaderDTOs
.Where(w => w.UserId == userDTO.Id && w.CheckStatus != CheckStatus.Blocked).ToList(); .Where(w => w.UserId == userDTO.Id).ToList();
CheckList.ItemsSource = result; CheckList.ItemsSource = result;
} }