ViewboxPage.xaml.cs 970 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Avalonia.Controls;
  2. using Avalonia.Markup.Xaml;
  3. using Avalonia.Media;
  4. namespace ControlCatalog.Pages
  5. {
  6. public class ViewboxPage : UserControl
  7. {
  8. public ViewboxPage()
  9. {
  10. InitializeComponent();
  11. var stretchSelector = this.FindControl<ComboBox>("StretchSelector");
  12. stretchSelector.Items = new[]
  13. {
  14. Stretch.Uniform, Stretch.UniformToFill, Stretch.Fill, Stretch.None
  15. };
  16. stretchSelector.SelectedIndex = 0;
  17. var stretchDirectionSelector = this.FindControl<ComboBox>("StretchDirectionSelector");
  18. stretchDirectionSelector.Items = new[]
  19. {
  20. StretchDirection.Both, StretchDirection.DownOnly, StretchDirection.UpOnly
  21. };
  22. stretchDirectionSelector.SelectedIndex = 0;
  23. }
  24. private void InitializeComponent()
  25. {
  26. AvaloniaXamlLoader.Load(this);
  27. }
  28. }
  29. }