2011-10-31 4 views
1

J'ai le problème, que les thèmes Toolkits ne veulent pas appliquer. J'ai installé Silverlight RC 5, Toolkit 5 et fonctionne dans Visual Studio 2010 avec un projet dans Silverlight 3 (ne m'offre pas Silverlight 4 ou plus).Silverlight Toolkit 5 Les thèmes ne fonctionnent pas

Eh bien, j'ai lu des milliers de tutoriels mais je ne vois pas mon erreur. Je suis capable d'utiliser ces contrôles de la boîte à outils correctement, mais le thème ... ne s'applique tout simplement pas.

Voici le 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> 

Et voici, ce que je vois:

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

S'il y avait des conseils, je serais apprécié =/

Répondre

0

Veuillez vérifier ce lien http://www.c-sharpcorner.com/UploadFile/mamta_m/working-with-themes-in-silverlight-toolkit-C-Sharp-based/

Il vous fournira une aide

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); 
    } 

J'espère que cela aide

Questions connexes