ViewboxPage.xaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.ViewboxPage">
  4. <UserControl.Resources>
  5. <StreamGeometry x:Key="Acorn">
  6. F1 M 16.6309,18.6563C 17.1309,
  7. 8.15625 29.8809,14.1563 29.8809,
  8. 14.1563C 30.8809,11.1563 34.1308,
  9. 11.4063 34.1308,11.4063C 33.5,12
  10. 34.6309,13.1563 34.6309,13.1563C
  11. 32.1309,13.1562 31.1309,14.9062
  12. 31.1309,14.9062C 41.1309,23.9062
  13. 32.6309,27.9063 32.6309,27.9062C
  14. 24.6309,24.9063 21.1309,22.1562
  15. 16.6309,18.6563 Z M 16.6309,19.9063C
  16. 21.6309,24.1563 25.1309,26.1562
  17. 31.6309,28.6562C 31.6309,28.6562
  18. 26.3809,39.1562 18.3809,36.1563C
  19. 18.3809,36.1563 18,38 16.3809,36.9063C
  20. 15,36 16.3809,34.9063 16.3809,34.9063C
  21. 16.3809,34.9063 10.1309,30.9062 16.6309,19.9063 Z
  22. </StreamGeometry>
  23. </UserControl.Resources>
  24. <Grid RowDefinitions="Auto,*">
  25. <StackPanel Orientation="Vertical" Spacing="4">
  26. <TextBlock Classes="h1">Viewbox</TextBlock>
  27. <TextBlock Classes="h2">A control used to scale single child.</TextBlock>
  28. </StackPanel>
  29. <Grid ColumnDefinitions="Auto,*,*"
  30. RowDefinitions="*,*,*,*"
  31. Grid.Row="1" Margin="48"
  32. MaxWidth="400">
  33. <TextBlock Grid.Row="0" VerticalAlignment="Center">None</TextBlock>
  34. <TextBlock Grid.Row="1" VerticalAlignment="Center">Fill</TextBlock>
  35. <TextBlock Grid.Row="2" VerticalAlignment="Center">Uniform</TextBlock>
  36. <TextBlock Grid.Row="3" VerticalAlignment="Center">UniformToFill</TextBlock>
  37. <Viewbox Grid.Row="0" Grid.Column="1" Stretch="None">
  38. <TextBlock>Hello World!</TextBlock>
  39. </Viewbox>
  40. <Viewbox Grid.Row="1" Grid.Column="1" Stretch="Fill">
  41. <TextBlock>Hello World!</TextBlock>
  42. </Viewbox>
  43. <Viewbox Grid.Row="2" Grid.Column="1" Stretch="Uniform">
  44. <TextBlock>Hello World!</TextBlock>
  45. </Viewbox>
  46. <Viewbox Grid.Row="3" Grid.Column="1" Stretch="UniformToFill">
  47. <TextBlock>Hello World!</TextBlock>
  48. </Viewbox>
  49. <Viewbox Grid.Row="0" Grid.Column="2" Stretch="None">
  50. <Path Fill="Blue" Data="{StaticResource Acorn}"/>
  51. </Viewbox>
  52. <Viewbox Grid.Row="1" Grid.Column="2" Stretch="Fill">
  53. <Path Fill="Blue" Data="{StaticResource Acorn}"/>
  54. </Viewbox>
  55. <Viewbox Grid.Row="2" Grid.Column="2" Stretch="Uniform">
  56. <Path Fill="Blue" Data="{StaticResource Acorn}"/>
  57. </Viewbox>
  58. <Viewbox Grid.Row="3" Grid.Column="2" Stretch="UniformToFill">
  59. <Path Fill="Blue" Data="{StaticResource Acorn}"/>
  60. </Viewbox>
  61. </Grid>
  62. </Grid>
  63. </UserControl>