summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs
new file mode 100644
index 00000000..054aca0f
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35078.cs
@@ -0,0 +1,34 @@
+using System.Threading.Tasks;
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+ [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 } };
+ }
+ }
+} \ No newline at end of file