Apply Theme Using Silverlight 4

So, I have been trying for some time to get them working in Silverlight 4.

I added a link to System.Windows.Controls.Theming.Toolkit and System.Windows.controls.Theming.ShinyRed

Then I went and did something like this:

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" xmlns:WebbyDraw="clr-namespace:WebbyDraw" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     x:Class="SilverlightApplication1.MainPage"
    Width="960" Height="700"  mc:Ignorable="d"
    xmlns:shinyRed="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.ShinyRed" >
<shinyRed:ShinyRedTheme>
<Grid x:Name="LayoutRoot2">
....
</Grid>
</shinyRed:ShinyRedTheme>
</UserControl>

But I always get the same old theme ... no errors, but nothing happens. I also tried other themes from Silverlight 4 Toolkit, and also tried to apply it to a single control ... nothing ... what am I doing wrong? I read several manuals and did not find the answer.

+3
source share
1 answer

theming, -
ShinyRed.xaml , ( ).

xmal

xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
<toolkit:Theme x:Name="ThemeContainer">
 <Grid x:Name="LayoutRoot">
... all other controls in the page
</Grid>

, shinyred, ShinyRed.xaml( , )

, App.xaml xaml !

<Application.Resources>
        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>                
                <ResourceDictionary Source="Assets/ShinyRed.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
0

Source: https://habr.com/ru/post/1762880/


All Articles