summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs
new file mode 100644
index 00000000..e1d36f72
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2659.xaml.cs
@@ -0,0 +1,64 @@
+´╗┐using System;
+using System.Collections.Generic;
+
+using Xamarin.Forms;
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+#if APP
+ [Preserve (AllMembers=true)]
+ [Issue (IssueTracker.Github, 2659, "", PlatformAffected.Android | PlatformAffected.iOS)]
+ public partial class Issue2659 : ContentPage
+ {
+ public Issue2659 ()
+ {
+ try {
+ InitializeComponent ();
+ }catch (Exception e){
+ System.Diagnostics.Debug.WriteLine (e.Message);
+ }
+ }
+
+ internal void OnSetStyleButtonClicked(object sender, EventArgs args)
+ {
+ Style style = (Style)Resources["buttonStyle"];
+ SetButtonStyle(style);
+ }
+
+ internal void OnUnsetStyleButtonClicked(object sender, EventArgs args)
+ {
+ SetButtonStyle (null);
+ }
+
+ internal void OnSetLocalButtonClicked(object sender, EventArgs args)
+ {
+ EnumerateButtons ((Button button) => {
+ button.TextColor = Color.Red;
+ button.FontAttributes = FontAttributes.Bold;
+ });
+ }
+
+ internal void OnClearLocalButtonClicked(object sender, EventArgs args)
+ {
+ EnumerateButtons ((Button button) => {
+ button.ClearValue (Button.TextColorProperty);
+ button.ClearValue (Button.FontAttributesProperty);
+ });
+ }
+
+ void SetButtonStyle(Style style)
+ {
+ EnumerateButtons (button => {
+ button.Style = style;
+ });
+ }
+
+ void EnumerateButtons(Action<Button> action)
+ {
+ foreach (View view in stackLayout.Children)
+ action ((Button)view);
+ }
+ }
+#endif
+} \ No newline at end of file