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]
|
[RelayCommand]
|
||||||
internal async Task SaveAsync()
|
internal async Task SaveAsync()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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}" />
|
||||||
|
|
@ -57,8 +51,8 @@
|
||||||
</CommandBarButton.Icon>
|
</CommandBarButton.Icon>
|
||||||
</CommandBarButton>
|
</CommandBarButton>
|
||||||
<CommandBarButton x:Name="ManageAclButton"
|
<CommandBarButton x:Name="ManageAclButton"
|
||||||
Label="ACL"
|
Label="ACL"
|
||||||
Command="{Binding ManageAclAsync}">
|
Command="{Binding ManageAclAsync}">
|
||||||
<CommandBarButton.Icon>
|
<CommandBarButton.Icon>
|
||||||
<PathIcon Data="{StaticResource AclIcon}" />
|
<PathIcon Data="{StaticResource AclIcon}" />
|
||||||
</CommandBarButton.Icon>
|
</CommandBarButton.Icon>
|
||||||
|
|
@ -83,63 +77,74 @@
|
||||||
</CommandBarButton>
|
</CommandBarButton>
|
||||||
</CommandBar.PrimaryCommands>
|
</CommandBar.PrimaryCommands>
|
||||||
</CommandBar>
|
</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 Margin="12" RowSpacing="12">
|
||||||
<Grid RowSpacing="10"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch">
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<WrapPanel Grid.Row="0" ItemSpacing="10">
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Text="Post detail" FontWeight="SemiBold" />
|
</WrapPanel>
|
||||||
<TextBox x:Name="DraftTitleTextBox"
|
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||||
Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
<ListBox ItemsSource="{Binding FilteredPosts}"
|
||||||
<TextBox Grid.Row="2" PlaceholderText="Write something here !"
|
SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
|
||||||
Text="{Binding DraftArticle, Mode=TwoWay}"
|
<ListBox.ItemTemplate>
|
||||||
MinHeight="320"
|
<DataTemplate x:DataType="models:BlogPostDto">
|
||||||
HorizontalAlignment="Stretch"
|
<StackPanel Spacing="4">
|
||||||
VerticalAlignment="Stretch" />
|
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" />
|
||||||
|
<TextBlock Text="{Binding DateModified, StringFormat='Updated: {0:yyyy-MM-dd HH:mm}'}" FontSize="10" Foreground="Gray" />
|
||||||
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" Padding="8">
|
<TextBlock Text="{Binding AuthorId}" FontSize="10" Foreground="DarkSlateGray" />
|
||||||
<StackPanel Spacing="4">
|
</StackPanel>
|
||||||
<TextBlock Text="Pièces jointes" FontWeight="SemiBold" />
|
</DataTemplate>
|
||||||
<ItemsControl ItemsSource="{Binding DraftAttachments}">
|
</ListBox.ItemTemplate>
|
||||||
<ItemsControl.ItemTemplate>
|
</ListBox>
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding FileName}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<postitControls:StatusBar Grid.Row="4"
|
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
||||||
DataContext="{Binding ActionStatus}" />
|
<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>
|
</Grid>
|
||||||
</Border>
|
</StackPanel>
|
||||||
</Grid>
|
</ScrollViewer>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue