1
votes

I've got the Problem, that Toolkits Themes just don't wanna apply. I've installed Silverlight RC 5, Toolkit 5 and are running in Visual Studio 2010 with a Project in Silverlight 3(doesnt offered me Silverlight 4 or higher though).

Well, I read a thousands of Tutorials but I cannot see my mistake. I am able to use those Controls of the Toolkit properly, but the Theme...just won't apply.

Here's the code:

<UserControl x:Class="Wissensmanagement.Controls.PCategory"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:theming="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.Toolkit"
xmlns:dark="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.ExpressionDark"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="625">

<Grid x:Name="LayoutRoot">

    <dark:ExpressionDarkTheme>

        <StackPanel HorizontalAlignment="Left">

            <Button Width="60" Height="30" x:Name="btnLoad" HorizontalAlignment="Left" Content="Test" />
            <controlsToolkit:Expander Header="test"/>

        </StackPanel>

    </dark:ExpressionDarkTheme>

</Grid>

And here is, what I See:

http://imageshack.us/photo/my-images/207/94160286.png/

If there were any hints, I would be appreciated =/

1

1 Answers

0
votes

Please Check this link http://www.c-sharpcorner.com/UploadFile/mamta_m/working-with-themes-in-silverlight-toolkit-C-Sharp-based/

It will provide you some help

    public Page()
    {
        InitializeComponent();
        Loaded += new RoutedEventHandler(Page_Loaded);
    }
    void Page_Loaded(object sender, RoutedEventArgs e)
    {
        Uri uri = new Uri(@"ThemeDemo;component/Microsoft.Windows.Controls.Theming.RainierOrange.xaml", UriKind.Relative);
        ImplicitStyleManager.SetResourceDictionaryUri(LayoutRoot, uri);
        ImplicitStyleManager.SetApplyMode(LayoutRoot, ImplicitStylesApplyMode.Auto);
        ImplicitStyleManager.Apply(LayoutRoot);
    }

I hope it helps