better and simpler UI

This commit is contained in:
Paul Schneider 2026-09-13 17:51:42 +01:00
commit f70f487777
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
4 changed files with 78 additions and 78 deletions

View file

@ -96,12 +96,6 @@ public partial class BlogsViewModel : ViewModelBase, IActionStatusViewModel
}); });
} }
[RelayCommand]
internal async Task SearchAsync() {
await RefreshAsync();
ApplyFilter();
}
[RelayCommand] [RelayCommand]
internal async Task SaveAsync() internal async Task SaveAsync()
{ {

View file

@ -346,7 +346,7 @@ public partial class Settings : ViewModelBase
// → our overridden dispatcher-safe marshaller below. // → our overridden dispatcher-safe marshaller below.
else lock (_mutationGate) else lock (_mutationGate)
{ {
var legacyApiUrl = TryReadLegacyApiUrl(json); var legacyApiUrl = TryReadApiUrl(json);
this.Authentication = settings.Authentication; this.Authentication = settings.Authentication;
this.DarkMode = settings.DarkMode; this.DarkMode = settings.DarkMode;
this.BlogsApiUrl = !string.IsNullOrWhiteSpace(settings.BlogsApiUrl) this.BlogsApiUrl = !string.IsNullOrWhiteSpace(settings.BlogsApiUrl)
@ -402,7 +402,7 @@ public partial class Settings : ViewModelBase
} }
} }
private static string? TryReadLegacyApiUrl(string json) private static string? TryReadApiUrl(string json)
{ {
try try
{ {

View file

@ -85,7 +85,8 @@
<Button Content="Ouvrir le détail" <Button Content="Ouvrir le détail"
Command="{Binding OpenSelectedQueryCommand}" /> Command="{Binding OpenSelectedQueryCommand}" />
<Button Content="Ouvrir en édition" <Button Content="Ouvrir en édition"
Command="{Binding OpenSelectedEditorCommand}" /> Command="{Binding OpenSelectedEditorCommand}"
/>
</StackPanel> </StackPanel>
</Grid> </Grid>

View file

@ -15,26 +15,20 @@
<Design.DataContext> <Design.DataContext>
<vm:BlogsViewModel /> <vm:BlogsViewModel />
</Design.DataContext> </Design.DataContext>
<ScrollViewer VerticalScrollBarVisibility="Visible"
<Grid Margin="12" RowSpacing="12" HorizontalScrollBarVisibility="Disabled"
HorizontalAlignment="Stretch" Padding="5"
VerticalAlignment="Stretch"> Margin="5"
<Grid.RowDefinitions> >
<RowDefinition Height="Auto" /> <StackPanel HorizontalAlignment="Stretch">
<RowDefinition Height="*" /> <StackPanel Orientation="Horizontal" Spacing="10" Margin="5">
<RowDefinition Height="Auto" /> <TextBlock Text="Blog Posts" FontSize="20" FontWeight="SemiBold" />
</Grid.RowDefinitions> <TextBox HorizontalAlignment="Right"
<WrapPanel Grid.Row="0" HorizontalAlignment="Stretch"> Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." />
<TextBlock Text="Blog Posts" FontSize="22" FontWeight="SemiBold" /> </StackPanel>
<TextBox Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." /> <CommandBar IsDynamicOverflowEnabled="True"
<CommandBar IsDynamicOverflowEnabled="True"> HorizontalAlignment="Right" >
<CommandBar.PrimaryCommands> <CommandBar.PrimaryCommands>
<CommandBarButton Label="Filter" Command="{Binding SearchAsync}">
<CommandBarButton.Icon>
<PathIcon Data="{StaticResource FilterIcon}" />
</CommandBarButton.Icon>
</CommandBarButton>
<CommandBarButton Label="Refresh" Command="{Binding RefreshAsync}"> <CommandBarButton Label="Refresh" Command="{Binding RefreshAsync}">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource RefreshIcon}" /> <PathIcon Data="{StaticResource RefreshIcon}" />
@ -83,10 +77,19 @@
</CommandBarButton> </CommandBarButton>
</CommandBar.PrimaryCommands> </CommandBar.PrimaryCommands>
</CommandBar> </CommandBar>
<Grid Margin="12" RowSpacing="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" ItemSpacing="10">
</WrapPanel> </WrapPanel>
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8"> <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8">
<ListBox ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}" <ListBox ItemsSource="{Binding FilteredPosts}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="40"> SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate x:DataType="models:BlogPostDto"> <DataTemplate x:DataType="models:BlogPostDto">
<StackPanel Spacing="4"> <StackPanel Spacing="4">
@ -142,4 +145,6 @@
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
</StackPanel>
</ScrollViewer>
</ContentPage> </ContentPage>