CreatorPostsView.axaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:m="using:VeloeAvaloniaKemonoPartyApp.Models"
  6. xmlns:vm="clr-namespace:VeloeAvaloniaKemonoPartyApp.ViewModels"
  7. xmlns:views="using:VeloeAvaloniaKemonoPartyApp.Views"
  8. xmlns:notif="using:Avalonia.Notification.Controls"
  9. mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="854"
  10. x:Class="VeloeAvaloniaKemonoPartyApp.Views.CreatorPostsView"
  11. MaxWidth="{Binding $self.Bounds.Height}"
  12. x:DataType="vm:CreatorPostsViewModel">
  13. <Design.DataContext>
  14. <!-- This only sets the DataContext for the previewer in an IDE,
  15. to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
  16. <vm:CreatorPostsViewModel />
  17. </Design.DataContext>
  18. <Panel HorizontalAlignment="Stretch">
  19. <notif:NotificationMessageContainer VerticalAlignment="Top" HorizontalAlignment="Stretch" Manager="{Binding Manager}" ZIndex="999"/>
  20. <ScrollViewer VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
  21. <StackPanel>
  22. <StackPanel Margin="10 10 10 10">
  23. <TextBox Watermark="Search in posts..." Text="{Binding SearchText}"/>
  24. <ProgressBar IsIndeterminate="True" IsVisible="{Binding IsBusy}"/>
  25. </StackPanel>
  26. <ItemsControl
  27. ItemsSource="{Binding Posts}"
  28. Background="Transparent">
  29. <ItemsControl.ItemTemplate>
  30. <DataTemplate>
  31. <views:PostView/>
  32. </DataTemplate>
  33. </ItemsControl.ItemTemplate>
  34. </ItemsControl>
  35. <Button
  36. Command="{Binding LoadMorePosts}"
  37. HorizontalContentAlignment="Center"
  38. HorizontalAlignment="Stretch"
  39. IsEnabled="{Binding !IsBusy}">Load More
  40. </Button>
  41. </StackPanel>
  42. </ScrollViewer>
  43. </Panel>
  44. </UserControl>