locked
Using more than one theme on the same page... RRS feed

  • Question

  • Hello,

    Does anyone know if it is possible to use more than one theme on the same page?  Or, is there a different/better method to applying different themes in selected areas of a page?  For example, if I were to build a form that has mandatory fields grouped at the top and optional fields grouped at the bottom and each would have its own theme.  Instead of applying a style manually to each set of items could I simply wrap each section with a theme similar to the way it can be accomplished in HTML with a div tag using an ID or Class?

    I'm looking for best practices, is there a preferred method?

    Regards,
    Bob
    Wednesday, July 7, 2010 10:03 PM

Answers

  • Hi Unni,

    Thank you for the reply.

    I figured out how to use multiple Themes on one page, actually very simple.

    <toolkit:Theme x:Name="ThemeContainer" ThemeUri="/System.Windows.Controls.Theming.TwilightBlue;component/Theme.xaml">
    
    <Button Content="Button" Height="Auto" Width="Auto"/>
    
    </toolkit:Theme>
    
    
    <toolkit:Theme x:Name="ThemeContainer2" ThemeUri="/System.Windows.Controls.Theming.ShinyBlue;component/Theme.xaml">
    
    <Button Content="Button" Height="Auto" Width="Auto"/>
    
    </toolkit:Theme>
    Regards,
    Bob
    • Marked as answer by Bobindy Thursday, July 8, 2010 3:47 PM
    Thursday, July 8, 2010 12:42 PM

All replies

  • Hi Bob,

    Yes, you can do this using Silverlight 4's implicit style feature.

    http://www.bing.com/search?q=silverlight+4+implict+styles&src=IE-SearchBox&FORM=IE8SRC

    Thanks,
    Unni


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, July 8, 2010 1:07 AM
  • Hi Unni,

    Thank you for the reply.

    I figured out how to use multiple Themes on one page, actually very simple.

    <toolkit:Theme x:Name="ThemeContainer" ThemeUri="/System.Windows.Controls.Theming.TwilightBlue;component/Theme.xaml">
    
    <Button Content="Button" Height="Auto" Width="Auto"/>
    
    </toolkit:Theme>
    
    
    <toolkit:Theme x:Name="ThemeContainer2" ThemeUri="/System.Windows.Controls.Theming.ShinyBlue;component/Theme.xaml">
    
    <Button Content="Button" Height="Auto" Width="Auto"/>
    
    </toolkit:Theme>
    Regards,
    Bob
    • Marked as answer by Bobindy Thursday, July 8, 2010 3:47 PM
    Thursday, July 8, 2010 12:42 PM