DymanicResource in C#

EthanPhoenixEthanPhoenix USMember ✭✭
edited November 2015 in Xamarin.Forms

Hi, the following code assigns DynamicResource style in Xaml. How to do the same in C#? I am trying to dynamically change the app styles.
Thanks,

Label Text="This uses SubtitleStyle in XAML" Style="{DynamicResource SubtitleStyle}"/>

Tagged:

Answers

  • IgorMoiseevIgorMoiseev USMember

    Something like that:

    var labelSection = new Label ();
    labelSection.Style = (Style)Application.Current.Resources ["SubtitleStyle"];

Sign In or Register to comment.