forked from xamarin/Xamarin.Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
123 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7361.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7361, "[UWP] Stepper display error when using Slider", PlatformAffected.UWP)] | ||
public class Issue7361 : TestContentPage | ||
{ | ||
Slider TheSlider; | ||
Stepper TheStepper; | ||
Label ValueLabel; | ||
|
||
public Issue7361() | ||
{ | ||
Title = "Issue 7361"; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
StackLayout layout = new StackLayout(); | ||
layout.Orientation = StackOrientation.Vertical; | ||
|
||
var instructions = new Label | ||
{ | ||
Margin = new Thickness(6), | ||
Text = "Slide slider to the extreme Right and Left, check that the Stepper to the right's +/- buttons work as expected, " + | ||
"becoming disabled at the Max and Min positions of the Slider, and then enabled again as the Slider moves towards the center." | ||
}; | ||
|
||
StackLayout controlsLayout = new StackLayout(); | ||
controlsLayout.Orientation= StackOrientation.Horizontal; | ||
controlsLayout.HorizontalOptions = LayoutOptions.FillAndExpand; | ||
|
||
TheSlider = new Slider | ||
{ | ||
Maximum = 100, | ||
Minimum = 1, | ||
HorizontalOptions = LayoutOptions.FillAndExpand, | ||
MinimumTrackColor = Color.LightPink, | ||
MaximumTrackColor = Color.LightPink | ||
}; | ||
controlsLayout.Children.Add(TheSlider); | ||
|
||
TheStepper = new Stepper | ||
{ | ||
Maximum = 100, | ||
Minimum = 1, | ||
Increment = 1 | ||
}; | ||
controlsLayout.Children.Add(TheStepper); | ||
|
||
StackLayout labelLayout = new StackLayout(); | ||
labelLayout.Orientation = StackOrientation.Horizontal; | ||
labelLayout.HorizontalOptions = LayoutOptions.FillAndExpand; | ||
|
||
Label valueHeaderLabel = new Label | ||
{ | ||
Text = "Value:", | ||
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) | ||
}; | ||
labelLayout.Children.Add(valueHeaderLabel); | ||
|
||
ValueLabel = new Label | ||
{ | ||
Text = "", | ||
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) | ||
}; | ||
labelLayout.Children.Add(ValueLabel); | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(controlsLayout); | ||
layout.Children.Add(labelLayout); | ||
|
||
Content = layout; | ||
|
||
TheSlider.Value = 50; | ||
TheStepper.Value = 50; | ||
TheSlider.ValueChanged += SliderChanged; | ||
TheStepper.ValueChanged += StepperChanged; | ||
} | ||
|
||
private void SliderChanged(object sender, ValueChangedEventArgs e) | ||
{ | ||
TheStepper.Value = e.NewValue; | ||
ValueLabel.Text = e.NewValue.ToString(); | ||
} | ||
|
||
private void StepperChanged(object sender, ValueChangedEventArgs e) | ||
{ | ||
TheSlider.Value = e.NewValue; | ||
ValueLabel.Text = e.NewValue.ToString(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters