ImagePage.xaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.ImagePage">
  4. <StackPanel Orientation="Vertical" Spacing="4">
  5. <TextBlock Classes="h1">Image</TextBlock>
  6. <TextBlock Classes="h2">Displays an image</TextBlock>
  7. <StackPanel Orientation="Horizontal"
  8. Margin="0,16,0,0"
  9. HorizontalAlignment="Center"
  10. Spacing="16">
  11. <StackPanel Orientation="Vertical">
  12. <TextBlock>No Stretch</TextBlock>
  13. <Image Source="/Assets/delicate-arch-896885_640.jpg"
  14. Width="100" Height="200"
  15. Stretch="None"/>
  16. </StackPanel>
  17. <StackPanel Orientation="Vertical">
  18. <TextBlock>Fill</TextBlock>
  19. <Image Source="/Assets/delicate-arch-896885_640.jpg"
  20. Width="100" Height="200"
  21. Stretch="Fill"/>
  22. </StackPanel>
  23. <StackPanel Orientation="Vertical">
  24. <TextBlock>Uniform</TextBlock>
  25. <Image Source="/Assets/delicate-arch-896885_640.jpg"
  26. Width="100" Height="200"
  27. Stretch="Uniform"/>
  28. </StackPanel>
  29. <StackPanel Orientation="Vertical">
  30. <TextBlock>UniformToFill</TextBlock>
  31. <Image Source="/Assets/delicate-arch-896885_640.jpg"
  32. Width="100" Height="200"
  33. Stretch="UniformToFill"/>
  34. </StackPanel>
  35. </StackPanel>
  36. <StackPanel Orientation="Vertical">
  37. <TextBlock>Window Icon as an Image</TextBlock>
  38. <Image Name="Icon" Width="100" Height="200" Stretch="None" />
  39. </StackPanel>
  40. </StackPanel>
  41. </UserControl>