Skip to content

Commit 77b538c

Browse files
committed
Change file namespace scope
1 parent 018b07c commit 77b538c

File tree

2 files changed

+55
-59
lines changed

2 files changed

+55
-59
lines changed
Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
11
using System.ComponentModel;
22
using System.Globalization;
33

4-
namespace Maui.Controls.Sample.Issues
4+
namespace Maui.Controls.Sample.Issues;
5+
[Issue(IssueTracker.Github, 28208, "[Windows] The Slider and Stepper control does not work in One-Way binding mode with a MultiBinding Converter", PlatformAffected.UWP)]
6+
public partial class Issue28208 : ContentPage
57
{
6-
[Issue(IssueTracker.Github, 28208, "[Windows] The Slider and Stepper control does not work in One-Way binding mode with a MultiBinding Converter", PlatformAffected.UWP)]
7-
public partial class Issue28208 : ContentPage
8+
Issue28208ViewModel _vm;
9+
public Issue28208()
810
{
9-
Issue28208ViewModel _vm;
10-
public Issue28208()
11-
{
12-
InitializeComponent();
13-
this.BindingContext = _vm = new Issue28208ViewModel();
14-
}
15-
16-
private void OnCounterClicked(object sender, EventArgs e)
17-
{
18-
if (_vm is not null)
19-
{
20-
_vm.Price++;
21-
}
22-
}
11+
InitializeComponent();
12+
this.BindingContext = _vm = new Issue28208ViewModel();
2313
}
2414

25-
public class Issue28208ViewModel : INotifyPropertyChanged
15+
private void OnCounterClicked(object sender, EventArgs e)
2616
{
27-
private double _price = 2;
28-
29-
public double Price
17+
if (_vm is not null)
3018
{
31-
get => _price;
32-
set
33-
{
34-
_price = value;
35-
OnPropertyChanged(nameof(Price));
36-
}
19+
_vm.Price++;
3720
}
38-
public event PropertyChangedEventHandler PropertyChanged;
21+
}
22+
}
23+
24+
public class Issue28208ViewModel : INotifyPropertyChanged
25+
{
26+
private double _price = 2;
3927

40-
private void OnPropertyChanged(string propertyName)
28+
public double Price
29+
{
30+
get => _price;
31+
set
4132
{
42-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
33+
_price = value;
34+
OnPropertyChanged(nameof(Price));
4335
}
4436
}
37+
public event PropertyChangedEventHandler PropertyChanged;
4538

46-
public class Issue28208OneWayMultiBindingValueConverter : IMultiValueConverter
39+
private void OnPropertyChanged(string propertyName)
4740
{
48-
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
49-
{
50-
if (values[0] is double price)
51-
{
52-
return price;
53-
}
41+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
42+
}
43+
}
5444

55-
return 0.0;
56-
}
57-
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
45+
public class Issue28208OneWayMultiBindingValueConverter : IMultiValueConverter
46+
{
47+
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
48+
{
49+
if (values[0] is double price)
5850
{
59-
throw new NotImplementedException();
51+
return price;
6052
}
53+
54+
return 0.0;
55+
}
56+
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
57+
{
58+
throw new NotImplementedException();
6159
}
6260
}

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28208.cs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
using UITest.Appium;
33
using UITest.Core;
44

5-
namespace Microsoft.Maui.TestCases.Tests.Issues
5+
namespace Microsoft.Maui.TestCases.Tests.Issues;
6+
public class Issue28208 : _IssuesUITest
67
{
7-
public class Issue28208 : _IssuesUITest
8-
{
9-
public Issue28208(TestDevice device) : base(device) { }
8+
public Issue28208(TestDevice device) : base(device) { }
109

11-
public override string Issue => "[Windows] The Slider and Stepper control does not work in One-Way binding mode with a MultiBinding Converter";
10+
public override string Issue => "[Windows] The Slider and Stepper control does not work in One-Way binding mode with a MultiBinding Converter";
1211

13-
[Test]
14-
[Category(UITestCategories.Slider)]
15-
[Category(UITestCategories.Stepper)]
16-
public void OneWayBindingWithMultiBindingConverterShouldReflecttInView()
17-
{
18-
App.WaitForElement("Button");
19-
App.Tap("Button");
20-
App.Tap("Button");
21-
var sliderLabel = App.FindElement("Sliderlabel").GetText();
22-
Assert.That(sliderLabel, Is.EqualTo("4"));
23-
var stepperLabel = App.FindElement("StepperLabel").GetText();
24-
Assert.That(stepperLabel, Is.EqualTo("4"));
25-
}
12+
[Test]
13+
[Category(UITestCategories.Slider)]
14+
[Category(UITestCategories.Stepper)]
15+
public void OneWayBindingWithMultiBindingConverterShouldReflecttInView()
16+
{
17+
App.WaitForElement("Button");
18+
App.Tap("Button");
19+
App.Tap("Button");
20+
var sliderLabel = App.FindElement("Sliderlabel").GetText();
21+
Assert.That(sliderLabel, Is.EqualTo("4"));
22+
var stepperLabel = App.FindElement("StepperLabel").GetText();
23+
Assert.That(stepperLabel, Is.EqualTo("4"));
2624
}
2725
}

0 commit comments

Comments
 (0)