|
|
|
@ -6,23 +6,18 @@ namespace ControlCatalog.Pages |
|
|
|
{ |
|
|
|
public class ViewboxPage : UserControl |
|
|
|
{ |
|
|
|
private readonly Viewbox _viewbox; |
|
|
|
private readonly ComboBox _stretchSelector; |
|
|
|
|
|
|
|
public ViewboxPage() |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
|
|
|
|
_viewbox = this.FindControl<Viewbox>("Viewbox"); |
|
|
|
|
|
|
|
_stretchSelector = this.FindControl<ComboBox>("StretchSelector"); |
|
|
|
var stretchSelector = this.FindControl<ComboBox>("StretchSelector"); |
|
|
|
|
|
|
|
_stretchSelector.Items = new[] |
|
|
|
stretchSelector.Items = new[] |
|
|
|
{ |
|
|
|
Stretch.Uniform, Stretch.UniformToFill, Stretch.Fill, Stretch.None |
|
|
|
}; |
|
|
|
|
|
|
|
_stretchSelector.SelectedIndex = 0; |
|
|
|
stretchSelector.SelectedIndex = 0; |
|
|
|
|
|
|
|
var stretchDirectionSelector = this.FindControl<ComboBox>("StretchDirectionSelector"); |
|
|
|
|
|
|
|
@ -38,10 +33,5 @@ namespace ControlCatalog.Pages |
|
|
|
{ |
|
|
|
AvaloniaXamlLoader.Load(this); |
|
|
|
} |
|
|
|
|
|
|
|
private void StretchSelector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) |
|
|
|
{ |
|
|
|
_viewbox.Stretch = (Stretch) _stretchSelector.SelectedItem!; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|