summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs
new file mode 100644
index 00000000..b24e8404
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1747.xaml.cs
@@ -0,0 +1,65 @@
+´╗┐using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+using Xamarin.Forms;
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+
+ public class ViewModel : INotifyPropertyChanged
+ {
+ bool _shouldBeToggled;
+ public bool ShouldBeToggled {
+ get { return _shouldBeToggled; }
+ set
+ {
+ _shouldBeToggled = value;
+ OnPropertyChanged ();
+ }
+ }
+
+ bool _shouldBeEnabled;
+ public bool ShouldBeEnabled {
+ get { return _shouldBeEnabled; }
+ set
+ {
+ _shouldBeEnabled = value;
+ OnPropertyChanged ();
+ }
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged ([CallerMemberName] string propertyName = null)
+ {
+ PropertyChangedEventHandler handler = PropertyChanged;
+ if (handler != null)
+ handler (this, new PropertyChangedEventArgs (propertyName));
+ }
+ }
+#if APP
+ [Preserve (AllMembers=true)]
+ [Issue (IssueTracker.Github, 1747, "Binding to Switch.IsEnabled has no effect", PlatformAffected.WinPhone)]
+ public partial class Issue1747 : ContentPage
+ {
+ readonly ViewModel _vm;
+
+ public Issue1747 ()
+ {
+ _vm = new ViewModel ();
+ BindingContext = _vm;
+ InitializeComponent ();
+ }
+
+ public void Button_OnClick (object sender, EventArgs args)
+ {
+ _vm.ShouldBeToggled = !_vm.ShouldBeToggled;
+ _vm.ShouldBeEnabled = !_vm.ShouldBeEnabled;
+ }
+ }
+#endif
+}
+