Disable DElButton when nothing to delete
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
||||
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
|
||||
x:Class="Jugenddienst_Stunden.Views.StundePage"
|
||||
Title="{Binding Title}">
|
||||
|
||||
@@ -9,6 +10,12 @@
|
||||
<models:StundeViewModel />
|
||||
</ContentPage.BindingContext>
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<conv:IntBoolConverter x:Key="IntBoolConverter" />
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<VerticalStackLayout Spacing="10" Margin="10">
|
||||
|
||||
<Label Text="{Binding SubTitle}" />
|
||||
@@ -43,7 +50,7 @@
|
||||
|
||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
||||
<Button Text="Speichern" Command="{Binding SaveCommand}" />
|
||||
<Button Grid.Column="1" Text="Löschen" Command="{Binding DeleteConfirmCommand}" />
|
||||
<Button Grid.Column="1" Text="Löschen" Command="{Binding DeleteConfirmCommand}" IsEnabled="{Binding Stunde.id, Converter={StaticResource IntBoolConverter}}" />
|
||||
</Grid>
|
||||
|
||||
<BoxView HeightRequest="1" Color="Red" Margin="5,10"/>
|
||||
|
||||
Reference in New Issue
Block a user