postIt #2

Merged
notazof merged 27 commits from postIt into main 2026-07-11 02:57:29 +01:00
Showing only changes of commit 13d985e4e3 - Show all commits

fixes the button access

Paul Schneider 2026-07-09 21:35:06 +01:00

View file

@ -5,8 +5,7 @@
x:Class="PostIt.Views.SettingsPage" x:Class="PostIt.Views.SettingsPage"
xmlns:vm="using:PostIt.ViewModels" xmlns:vm="using:PostIt.ViewModels"
x:DataType="vm:Settings" x:DataType="vm:Settings"
Width="400" >
Height="300">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@ -47,12 +46,16 @@
<TextBlock Grid.Row="10" Text="Dark mode"/> <TextBlock Grid.Row="10" Text="Dark mode"/>
<CheckBox Grid.Row="11" x:Name="DarkModeCheckBox" IsChecked="{Binding DarkMode, Mode=TwoWay}"/> <CheckBox Grid.Row="11" x:Name="DarkModeCheckBox" IsChecked="{Binding DarkMode, Mode=TwoWay}"/>
<!-- Sauver: bound to the SaveCommand on the Settings VM, with <!-- Sauver: bound to the Save RelayCommand on the Settings
IsEnabled driven by the inverse of IsDirty so the button VM. The source generator emits an ICommand property whose
auto-disables when there's nothing to persist. --> name matches the source method exactly (no "Command"
suffix is added), so we bind {Binding Save} here. See
AGENTS.md "Avalonia + CommunityToolkit.Mvvm : conventions
de binding pour [RelayCommand]" for the full rationale.
IsEnabled tracks IsDirty so the button auto-disables
when there's nothing to persist. -->
<Button Grid.Row="12" Content="Sauver" <Button Grid.Row="12" Content="Sauver"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,12,0,0"
Command="{Binding Save}" Command="{Binding Save}"
IsEnabled="{Binding IsDirty}"/> IsEnabled="{Binding IsDirty}"/>