better and simpler UI
This commit is contained in:
parent
1af839e14e
commit
f70f487777
4 changed files with 78 additions and 78 deletions
|
|
@ -96,12 +96,6 @@ public partial class BlogsViewModel : ViewModelBase, IActionStatusViewModel
|
|||
});
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
internal async Task SearchAsync() {
|
||||
await RefreshAsync();
|
||||
ApplyFilter();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
internal async Task SaveAsync()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ public partial class Settings : ViewModelBase
|
|||
// → our overridden dispatcher-safe marshaller below.
|
||||
else lock (_mutationGate)
|
||||
{
|
||||
var legacyApiUrl = TryReadLegacyApiUrl(json);
|
||||
var legacyApiUrl = TryReadApiUrl(json);
|
||||
this.Authentication = settings.Authentication;
|
||||
this.DarkMode = settings.DarkMode;
|
||||
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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@
|
|||
<Button Content="Ouvrir le détail"
|
||||
Command="{Binding OpenSelectedQueryCommand}" />
|
||||
<Button Content="Ouvrir en édition"
|
||||
Command="{Binding OpenSelectedEditorCommand}" />
|
||||
Command="{Binding OpenSelectedEditorCommand}"
|
||||
/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,26 +15,20 @@
|
|||
<Design.DataContext>
|
||||
<vm:BlogsViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid Margin="12" RowSpacing="12"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<WrapPanel Grid.Row="0" HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="Blog Posts" FontSize="22" FontWeight="SemiBold" />
|
||||
<TextBox Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." />
|
||||
<CommandBar IsDynamicOverflowEnabled="True">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Visible"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="5"
|
||||
Margin="5"
|
||||
>
|
||||
<StackPanel HorizontalAlignment="Stretch">
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" Margin="5">
|
||||
<TextBlock Text="Blog Posts" FontSize="20" FontWeight="SemiBold" />
|
||||
<TextBox HorizontalAlignment="Right"
|
||||
Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." />
|
||||
</StackPanel>
|
||||
<CommandBar IsDynamicOverflowEnabled="True"
|
||||
HorizontalAlignment="Right" >
|
||||
<CommandBar.PrimaryCommands>
|
||||
|
||||
<CommandBarButton Label="Filter" Command="{Binding SearchAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource FilterIcon}" />
|
||||
</CommandBarButton.Icon>
|
||||
</CommandBarButton>
|
||||
<CommandBarButton Label="Refresh" Command="{Binding RefreshAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource RefreshIcon}" />
|
||||
|
|
@ -57,8 +51,8 @@
|
|||
</CommandBarButton.Icon>
|
||||
</CommandBarButton>
|
||||
<CommandBarButton x:Name="ManageAclButton"
|
||||
Label="ACL"
|
||||
Command="{Binding ManageAclAsync}">
|
||||
Label="ACL"
|
||||
Command="{Binding ManageAclAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource AclIcon}" />
|
||||
</CommandBarButton.Icon>
|
||||
|
|
@ -83,63 +77,74 @@
|
|||
</CommandBarButton>
|
||||
</CommandBar.PrimaryCommands>
|
||||
</CommandBar>
|
||||
</WrapPanel>
|
||||
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||
<ListBox ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="40">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:BlogPostDto">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding DateModified, StringFormat='Updated: {0:yyyy-MM-dd HH:mm}'}" FontSize="10" Foreground="Gray" />
|
||||
<TextBlock Text="{Binding AuthorId}" FontSize="10" Foreground="DarkSlateGray" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||
<Grid RowSpacing="10"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid Margin="12" RowSpacing="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<WrapPanel Grid.Row="0" ItemSpacing="10">
|
||||
|
||||
<TextBlock Grid.Row="0" Text="Post detail" FontWeight="SemiBold" />
|
||||
<TextBox x:Name="DraftTitleTextBox"
|
||||
Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
||||
<TextBox Grid.Row="2" PlaceholderText="Write something here !"
|
||||
Text="{Binding DraftArticle, Mode=TwoWay}"
|
||||
MinHeight="320"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
|
||||
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" Padding="8">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Pièces jointes" FontWeight="SemiBold" />
|
||||
<ItemsControl ItemsSource="{Binding DraftAttachments}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding FileName}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||
<ListBox ItemsSource="{Binding FilteredPosts}"
|
||||
SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:BlogPostDto">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding DateModified, StringFormat='Updated: {0:yyyy-MM-dd HH:mm}'}" FontSize="10" Foreground="Gray" />
|
||||
<TextBlock Text="{Binding AuthorId}" FontSize="10" Foreground="DarkSlateGray" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
|
||||
<postitControls:StatusBar Grid.Row="4"
|
||||
DataContext="{Binding ActionStatus}" />
|
||||
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||
<Grid RowSpacing="10"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="Post detail" FontWeight="SemiBold" />
|
||||
<TextBox x:Name="DraftTitleTextBox"
|
||||
Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
||||
<TextBox Grid.Row="2" PlaceholderText="Write something here !"
|
||||
Text="{Binding DraftArticle, Mode=TwoWay}"
|
||||
MinHeight="320"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
|
||||
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" Padding="8">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Pièces jointes" FontWeight="SemiBold" />
|
||||
<ItemsControl ItemsSource="{Binding DraftAttachments}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding FileName}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<postitControls:StatusBar Grid.Row="4"
|
||||
DataContext="{Binding ActionStatus}" />
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ContentPage>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue