UI rendberakása
This commit is contained in:
@@ -55,8 +55,10 @@
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<!-- Bal oldali oszlop: Két Label egymás alatt -->
|
||||
<StackLayout Grid.Column="0" Spacing="2">
|
||||
<Label Text="{Binding DocumentNumber}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding DateExecution}" FontSize="14" />
|
||||
<Label Text="{Binding DocumentNumber}" FontSize="14" FontAttributes="Bold" />
|
||||
<Label Text="{Binding DateExecution}" FontSize="12" />
|
||||
<Label Text="{Binding CheckListTemplateHeaderDTO.ShortName}" FontSize="10" />
|
||||
<Label Text="{Binding StatusName}" FontSize="10" />
|
||||
</StackLayout>
|
||||
|
||||
<!-- Jobb oldali oszlop: Két gomb egymás mellett -->
|
||||
@@ -64,21 +66,21 @@
|
||||
<Button Text="Blokkolás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Red"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedHideConverter}}"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedConverter}}"
|
||||
Command="{Binding BindingContext.BlockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text="Feloldás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Green"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedVisibleConverter}}"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource UnBlockedConverter}}"
|
||||
Command="{Binding BindingContext.UnblockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text="Folytatás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Blue"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedHideConverter}}"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource ContinueConverter}}"
|
||||
Command="{Binding BindingContext.ContinueCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
@@ -142,8 +144,9 @@
|
||||
</Grid>
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<local:BlockedVisibleConverter x:Key="BlockedVisibleConverter" />
|
||||
<local:BlockedHideConverter x:Key="BlockedHideConverter" />
|
||||
<local:BlockedConverter x:Key="BlockedConverter" />
|
||||
<local:UnBlockedConverter x:Key="UnBlockedConverter" />
|
||||
<local:ContinueConverter x:Key="ContinueConverter" />
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
</ContentPage>
|
||||
@@ -168,13 +168,13 @@ public partial class CheckListPage : ContentPage
|
||||
|
||||
}
|
||||
|
||||
public class BlockedVisibleConverter : IValueConverter
|
||||
public class BlockedConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
{
|
||||
return status == CheckStatus.Blocked;
|
||||
return status == CheckStatus.InProgress;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -184,13 +184,33 @@ public class BlockedVisibleConverter : IValueConverter
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public class BlockedHideConverter : IValueConverter
|
||||
public class UnBlockedConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
{
|
||||
if (status == CheckStatus.Open || status == CheckStatus.InProgress)
|
||||
if (status == CheckStatus.Blocked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public class ContinueConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
{
|
||||
if (status == CheckStatus.InProgress || status == CheckStatus.Open)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user