Blokkolás és frissítés is
This commit is contained in:
@@ -198,20 +198,23 @@
|
||||
Margin="1"
|
||||
CornerRadius="10"
|
||||
HasShadow="True">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
|
||||
<CollectionView x:Name="CheckListTemplate">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame BorderColor="Gray" Padding="10" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackLayout>
|
||||
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding Description}" FontSize="14" />
|
||||
</StackLayout>
|
||||
<HorizontalStackLayout HorizontalOptions="End">
|
||||
<Button Text="Új ellenőrzés"
|
||||
<RefreshView x:Name="CheckListTemplateRefreshView"
|
||||
IsRefreshing="{Binding IsRefreshingT}"
|
||||
Command="{Binding RefreshCommandT}">
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Új ellenőrzés" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
|
||||
<CollectionView x:Name="CheckListTemplate">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame BorderColor="Gray" Padding="10" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackLayout>
|
||||
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding Description}" FontSize="14" />
|
||||
</StackLayout>
|
||||
<HorizontalStackLayout HorizontalOptions="End">
|
||||
<Button Text="Új ellenőrzés"
|
||||
BackgroundColor="Green"
|
||||
Margin="5,0,0,0"
|
||||
HeightRequest="50"
|
||||
@@ -220,14 +223,15 @@
|
||||
MaximumWidthRequest="120"
|
||||
Command="{Binding BindingContext.NewCommand, Source={x:Reference CheckListTemplate}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user