-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla35078.cs
41 lines (36 loc) · 1.02 KB
/
Bugzilla35078.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Threading.Tasks;
using Xamarin.Forms.CustomAttributes;
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)]
#endif
[Issue(IssueTracker.Bugzilla, 35078,
"Checking IsInvokeRequired on WinRT when off the dispatcher thread causes a null reference exception",
PlatformAffected.WinRT)]
public class Bugzilla35078 : TestContentPage
{
protected override void Init()
{
var button = new Button { Text = "Go" };
var instructions = new Label
{
Text =
"Click the 'Go' button. If the application crashes or a label with the text 'Sucess' does not appear, the test has failed."
};
var success = new Label();
button.Clicked += (sender, args) =>
{
Task.Run(() =>
{
bool invokeRequired = Device.IsInvokeRequired;
if (invokeRequired)
{
Device.BeginInvokeOnMainThread(() => success.Text = "Success");
}
});
};
Content = new StackLayout { Children = { instructions, button, success } };
}
}
}