maui-linux/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issu.../Bugzilla25662.cs

54 строки
1.1 KiB
C#
Исходник Обычный вид История

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
2016-03-22 23:02:25 +03:00
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Cells)]
#endif
2016-03-22 23:02:25 +03:00
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 25662, "Setting IsEnabled does not disable SwitchCell")]
public class Bugzilla25662 : TestContentPage
2016-03-22 23:02:25 +03:00
{
[Preserve(AllMembers = true)]
2016-03-22 23:02:25 +03:00
class MySwitch : SwitchCell
{
public MySwitch ()
{
IsEnabled = false;
SetBinding(SwitchCell.TextProperty, new Binding("."));
OnChanged += (sender, e) => Text = "FAIL";
2016-03-22 23:02:25 +03:00
}
}
protected override void Init ()
2016-03-22 23:02:25 +03:00
{
var list = new ListView {
ItemsSource = new[] {
"One", "Two", "Three"
},
ItemTemplate = new DataTemplate (typeof (MySwitch))
};
Content = list;
}
2016-03-22 23:02:25 +03:00
#if UITEST
[Test]
public void Bugzilla25662Test ()
{
RunningApp.WaitForElement (q => q.Marked ("One"));
RunningApp.Tap(q => q.Marked("One"));
RunningApp.WaitForNoElement(q => q.Marked("FAIL"));
2016-03-22 23:02:25 +03:00
}
#endif
}
2016-03-22 23:02:25 +03:00
}