Egy kis UI rendezés
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.MAUI.Pages.NFC;
|
||||
using WorkFlowCheck.MAUI.Services.Interfaces;
|
||||
|
||||
@@ -16,6 +18,7 @@ public partial class CheckListPage : ContentPage
|
||||
|
||||
public ICommand NewCommand { get; set; }
|
||||
public ICommand ContinueCommand { get; set; }
|
||||
public ICommand UnblockCommand { get; set; }
|
||||
public bool IsLoading
|
||||
{
|
||||
get => _isLoading;
|
||||
@@ -34,6 +37,7 @@ public partial class CheckListPage : ContentPage
|
||||
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
|
||||
NewCommand = new Command<CheckListTemplateHeaderDTO>(OnNewItem);
|
||||
ContinueCommand = new Command<CheckListHeaderDTO>(OnContinueItem);
|
||||
UnblockCommand = new Command<CheckListHeaderDTO>(OnUnblockItem);
|
||||
|
||||
}
|
||||
protected override bool OnBackButtonPressed()
|
||||
@@ -53,8 +57,8 @@ public partial class CheckListPage : ContentPage
|
||||
{
|
||||
IsLoading = true;
|
||||
await _checkListService.StartNew(
|
||||
new CheckListHeaderNewDTO()
|
||||
{
|
||||
new CheckListHeaderNewDTO()
|
||||
{
|
||||
UserId = _userService.GetCurrentUser().Id,
|
||||
CheckListTemplateHeaderId = checkListTemplateHeaderDTO.Id
|
||||
});
|
||||
@@ -72,6 +76,10 @@ public partial class CheckListPage : ContentPage
|
||||
|
||||
await Navigation.PushAsync(new CheckListWorkPage(checkListHeaderDTO.Id, checkPointCode));
|
||||
}
|
||||
}
|
||||
private async void OnUnblockItem(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
|
||||
}
|
||||
private async Task LoadCheckListTemplate()
|
||||
{
|
||||
@@ -88,4 +96,41 @@ public partial class CheckListPage : ContentPage
|
||||
IsLoading = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class BlockedVisibleConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
{
|
||||
return status == CheckStatus.Blocked;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public class BlockedHideConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
{
|
||||
if (status == CheckStatus.Open || status == CheckStatus.InProgress)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user