using System; using System.Collections.Generic; using Xamarin.Forms; using NUnit.Framework; using Xamarin.Forms.Core.UnitTests; namespace Xamarin.Forms.Xaml.UnitTests { public partial class Issue2659 : ContentPage { public Issue2659 () { InitializeComponent (); } public Issue2659 (bool useCompiledXaml) { //this stub will be replaced at compile time } void OnSetStyleButtonClicked(object sender, EventArgs args) { Style style = (Style)Resources["buttonStyle"]; SetButtonStyle(style); } void OnUnsetStyleButtonClicked(object sender, EventArgs args) { SetButtonStyle (null); } void OnSetLocalButtonClicked(object sender, EventArgs args) { EnumerateButtons ((Button button) => { button.TextColor = Color.Red; button.FontAttributes = FontAttributes.Bold; }); } 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