2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
#if UITEST
|
2016-11-15 22:39:23 +03:00
|
|
|
|
using Xamarin.Forms.Core.UITests;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
using Xamarin.UITest;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2016-11-15 22:39:23 +03:00
|
|
|
|
#if UITEST
|
|
|
|
|
[Category(UITestCategories.Cells)]
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
[Issue (IssueTracker.Bugzilla, 32040, "EntryCell.Tapped or SwitchCell.Tapped does not fire when within a TableView ")]
|
|
|
|
|
public class Bugzilla32040 : TestContentPage // or TestMasterDetailPage, etc ...
|
|
|
|
|
{
|
|
|
|
|
protected override void Init ()
|
|
|
|
|
{
|
|
|
|
|
var switchCell = new SwitchCell { Text = "blahblah" };
|
|
|
|
|
switchCell.Tapped += (s, e) =>
|
|
|
|
|
{
|
|
|
|
|
switchCell.Text = "Tapped";
|
|
|
|
|
};
|
|
|
|
|
switchCell.OnChanged += (sender, e) => {
|
|
|
|
|
switchCell.Text = "Switched";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var entryCell = new EntryCell { Text = "yaddayadda" };
|
2016-04-11 19:50:28 +03:00
|
|
|
|
#pragma warning disable 618
|
2016-03-22 23:02:25 +03:00
|
|
|
|
entryCell.XAlign = TextAlignment.End;
|
2016-04-11 19:50:28 +03:00
|
|
|
|
#pragma warning restore 618
|
2016-03-22 23:02:25 +03:00
|
|
|
|
entryCell.Label = "Click Here";
|
|
|
|
|
entryCell.Tapped += (s, e) =>
|
|
|
|
|
{
|
|
|
|
|
entryCell.Text = "Tapped";
|
|
|
|
|
};
|
|
|
|
|
entryCell.Completed += (sender, e) => {
|
|
|
|
|
entryCell.Text = "Completed";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The root page of your application
|
|
|
|
|
Content = new TableView {
|
|
|
|
|
Intent = TableIntent.Form,
|
|
|
|
|
Root = new TableRoot ("Table Title") {
|
|
|
|
|
new TableSection ("Section 1 Title") {
|
|
|
|
|
switchCell,
|
|
|
|
|
entryCell
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#if UITEST
|
|
|
|
|
[Test]
|
|
|
|
|
public void TappedWorksForEntryAndSwithCellTest ()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.Tap (q => q.Marked ("blahblah"));
|
|
|
|
|
RunningApp.Tap (q => q.Marked ("Click Here"));
|
|
|
|
|
Assert.GreaterOrEqual (RunningApp.Query (q => q.Marked ("Tapped")).Length, 2);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|