top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

WindowsPhone Styles:Get and apply Explicit style with c#?

+1 vote
396 views
WindowsPhone Styles:Get and apply Explicit style with c#?
posted Jun 17, 2015 by Puhal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Not able to understand the query

2 Answers

+1 vote

See in below there is explicit style name is "MyCustomStyle" for TextBlock,so you can get this style with c# and apply like this.

App.xaml

<Application.Resources>
        <Style x:Key="MyCustomStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="8" />
        </Style>
</Application.Resources>

C

Txtblk.Style = (Style)App.Current.Resources["MyCustomstyle"];

answer Jun 18, 2015 by Jdk
–1 vote

BY using C command and also use # tag to improve the power

answer Jun 17, 2015 by Shiv Shukla
...