11using System . ComponentModel ;
22using 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}
0 commit comments