summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-02-06 15:16:54 +0100
committerStephane Delcroix <stephane@delcroix.org>2017-02-06 15:16:54 +0100
commitfc7d556848e731902d096953c9b4fb28a2466e6b (patch)
treec3c9f63f93bcf77af253aa027acc9648d2ffa7dd /Xamarin.Forms.Controls
parent28237b7b27ef318b2c811e9829c2442613c42feb (diff)
downloadxamarin-forms-fc7d556848e731902d096953c9b4fb28a2466e6b.tar.gz
xamarin-forms-fc7d556848e731902d096953c9b4fb28a2466e6b.tar.bz2
xamarin-forms-fc7d556848e731902d096953c9b4fb28a2466e6b.zip
[*] ScaleX and ScaleY
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs37
1 files changed, 31 insertions, 6 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs b/Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs
index e189f839..18276d81 100644
--- a/Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs
+++ b/Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs
@@ -39,19 +39,41 @@ namespace Xamarin.Forms.Controls
scaleSlider.SetBinding(Slider.ValueProperty,
new Binding("Scale", BindingMode.TwoWay));
+ // Label and Slider for ScaleX property.
+ Label scaleXSliderValue = new Label {
+ VerticalTextAlignment = TextAlignment.Center
+ };
+ Grid.SetRow(scaleXSliderValue, 1);
+ Grid.SetColumn(scaleXSliderValue, 0);
+
+ Slider scaleXSlider = new Slider {
+ Maximum = 10
+ };
+ Grid.SetRow(scaleXSlider, 1);
+ Grid.SetColumn(scaleXSlider, 1);
+
+ // Set Bindings.
+ scaleXSliderValue.BindingContext = scaleXSlider;
+ scaleXSliderValue.SetBinding(Label.TextProperty,
+ new Binding("Value", BindingMode.OneWay, null, null, "ScaleX = {0:F1}"));
+
+ scaleXSlider.BindingContext = label;
+ scaleXSlider.SetBinding(Slider.ValueProperty,
+ new Binding("ScaleX", BindingMode.TwoWay));
+
// Label and Slider for Rotation property.
Label rotationSliderValue = new Label
{
VerticalTextAlignment = TextAlignment.Center
};
- Grid.SetRow(rotationSliderValue, 1);
+ Grid.SetRow(rotationSliderValue, 2);
Grid.SetColumn(rotationSliderValue, 0);
Slider rotationSlider = new Slider
{
Maximum = 360
};
- Grid.SetRow(rotationSlider, 1);
+ Grid.SetRow(rotationSlider, 2);
Grid.SetColumn(rotationSlider, 1);
// Set Bindings.
@@ -68,7 +90,7 @@ namespace Xamarin.Forms.Controls
{
VerticalTextAlignment = TextAlignment.Center
};
- Grid.SetRow(anchorxStepperValue, 2);
+ Grid.SetRow(anchorxStepperValue, 3);
Grid.SetColumn(anchorxStepperValue, 0);
Stepper anchorxStepper = new Stepper
@@ -77,7 +99,7 @@ namespace Xamarin.Forms.Controls
Minimum = -1,
Increment = 0.5
};
- Grid.SetRow(anchorxStepper, 2);
+ Grid.SetRow(anchorxStepper, 3);
Grid.SetColumn(anchorxStepper, 1);
// Set bindings.
@@ -94,7 +116,7 @@ namespace Xamarin.Forms.Controls
{
VerticalTextAlignment = TextAlignment.Center
};
- Grid.SetRow(anchoryStepperValue, 3);
+ Grid.SetRow(anchoryStepperValue, 4);
Grid.SetColumn(anchoryStepperValue, 0);
Stepper anchoryStepper = new Stepper
@@ -103,7 +125,7 @@ namespace Xamarin.Forms.Controls
Minimum = -1,
Increment = 0.5
};
- Grid.SetRow(anchoryStepper, 3);
+ Grid.SetRow(anchoryStepper, 4);
Grid.SetColumn(anchoryStepper, 1);
// Set bindings.
@@ -130,6 +152,7 @@ namespace Xamarin.Forms.Controls
new RowDefinition { Height = GridLength.Auto },
new RowDefinition { Height = GridLength.Auto },
new RowDefinition { Height = GridLength.Auto },
+ new RowDefinition { Height = GridLength.Auto },
},
ColumnDefinitions =
{
@@ -140,6 +163,8 @@ namespace Xamarin.Forms.Controls
{
scaleSliderValue,
scaleSlider,
+ scaleXSliderValue,
+ scaleXSlider,
rotationSliderValue,
rotationSlider,
anchorxStepperValue,