summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs
new file mode 100644
index 00000000..90c5ee57
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1742.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers=true)]
+ [Issue (IssueTracker.Github, 1742, "Invisible Button still fires Clicked event", PlatformAffected.WinPhone)]
+ public class Issue1742 : ContentPage
+ {
+ public Issue1742 ()
+ {
+ var listView = new ListView
+ {
+ RowHeight = 40
+ };
+ var invisibleButton = new Button
+ {
+ IsVisible = false,
+ Text = "INVISIBLE button"
+ };
+ var visibleButton = new Button
+ {
+ IsVisible = true,
+ Text = "Visible button"
+ };
+
+ invisibleButton.Clicked += Button_Clicked;
+ visibleButton.Clicked += Button_Clicked;
+ listView.ItemTapped += ListView_ItemTapped;
+
+ listView.ItemsSource = new string[] { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
+
+ Content = new StackLayout {
+ VerticalOptions = LayoutOptions.FillAndExpand,
+ Children = { listView, visibleButton, invisibleButton }
+ };
+
+ }
+
+ void ListView_ItemTapped(object sender, ItemTappedEventArgs args)
+ {
+ DisplayAlert("Alert", "List item tapped", "OK", "Cancel");
+ }
+
+ void Button_Clicked(object sender, EventArgs args)
+ {
+ DisplayAlert("Alert", ((Button)sender).Text + " clicked", "OK", "Cancel");
+ }
+ }
+} \ No newline at end of file