95 lines
4.6 KiB
XML
95 lines
4.6 KiB
XML
<ContentPage xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:PostIt.ViewModels"
|
|
xmlns:models="using:PostIt.Models"
|
|
xmlns:views="using:PostIt.Views"
|
|
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
|
|
mc:Ignorable="d"
|
|
x:Class="PostIt.Views.MainPage"
|
|
x:DataType="vm:MainPageViewModel"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
<Design.DataContext>
|
|
<vm:MainPageViewModel />
|
|
</Design.DataContext>
|
|
|
|
<Grid Margin="12" RowSpacing="12"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Spacing="12"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Top">
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<Button Command="{Binding LoadPosts}" Content="Load posts" />
|
|
<Button Command="{Binding Search}" Content="Filter" />
|
|
<Button Command="{Binding Save}" Content="Save" />
|
|
<Button Command="{Binding Delete}" Content="Delete" />
|
|
<!--
|
|
DEV ONLY: temporary shortcut to open the signature
|
|
capture page. Production entry point is a SignalR
|
|
push from Yavsc.Org ("devis received, sign here").
|
|
Remove this button and its Click handler in
|
|
MainPage.axaml.cs once the SignalR handler lands.
|
|
-->
|
|
<Button x:Name="OpenSignatureDevButton"
|
|
Content="[DEV] Signature"
|
|
Click="OpenSignatureDev"
|
|
ToolTip.Tip="DEV ONLY — to remove when SignalR handler lands" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8">
|
|
<ListBox ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="models:BlogPost">
|
|
<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.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 Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
|
<AvaloniaEdit:TextEditor Grid.Row="2"
|
|
views:TextEditorBinding.Text="{Binding DraftArticle, Mode=TwoWay}"
|
|
ShowLineNumbers="True"
|
|
FontFamily="Cascadia Code, Consolas, Menlo, Monospace"
|
|
MinHeight="320"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
VerticalScrollBarVisibility="Auto"
|
|
HorizontalScrollBarVisibility="Auto" />
|
|
<TextBlock Grid.Row="3" Text="{Binding StatusMessage}" Foreground="Gray" />
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</ContentPage>
|