This is a migrated thread and some comments may be shown as answers.

How to change default window theme

5 Answers 250 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ivan Kopcanski
Top achievements
Rank 1
Ivan Kopcanski asked on 07 May 2010, 11:15 AM
Hello, I've tried to change the window theme on the inherited RadWindow on several ways:

1.) In XAML itself:
<base:WindowBase x:Class="ListScreenView"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    telerik:Theming.Theme="Windows7" ...>
or 
    telerik:StyleManager.Theme="Windows7" ..>

2.) in code-behind:
class ListScreenView : WindowBase
{
public ListScreenView()
        {
            InitializeComponent();

            Theme theme = ThemeManager.FromName("Windows7");
            StyleManager.SetTheme(this, theme);
        }
...
}

3.) On application level by:
     StyleManager.ApplicationTheme = ThemeManager.FromName("Windows7"); 

And none of this works. Window keeps the default theme other than Windows 7 one. 
I wish to be able to change the window border style by changing the theme on the window.
Can you please assist me on this issue? 

5 Answers, 1 is accepted

Sort by
0
Accepted
Ross Wozniak
Top achievements
Rank 1
answered on 07 May 2010, 08:35 PM
Hi Ivan,

Have you included a reference to the Telerik.Windows.Themes.Windows7.dll in your project?

Ross
0
Ivan Kopcanski
Top achievements
Rank 1
answered on 11 May 2010, 08:13 AM
Hi, Ross,

    The Telerik.Windows.Themes.Windows7 assembly reference was missing in the project. 
The window was shown with related theme applied in XAML, but the window behaved strange.
The properties that have been applied in style before did not work after setting the theme.
These properties started to work after they are moved from style directly to the window itself.
One of these properties are WindowStartupLocation, Width and Height

It seems to me that the settings have their priority: 

1.) Some properties (not all of them) in XAML itself have the highest priority,
2.) Then the theme properties are forced,
3.) The properties in styles have the lowest priority.

  I'm asking myself am I right. Can you clarify that if you know the cause? 

      
0
Miroslav Nedyalkov
Telerik team
answered on 11 May 2010, 12:20 PM
Hi Ivan,

 Setting the theme actually sets a style to the Window and this is the reason why the Theme overrides your style - it is set after the style.

All the best,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ivan Kopcanski
Top achievements
Rank 1
answered on 12 May 2010, 10:41 AM
Have the Telerik SL controls been affected by some 'default' theme, if no theme is set either on app. level or control level explicitly?
If this is the true there are only two possibilities to force my own styles:

1.) Extract and edit controls template
2.) Create custom theme XAML file and apply it to some or all of Telerik controls.

Is there any easier solution?

0
Miroslav Nedyalkov
Telerik team
answered on 15 May 2010, 12:47 PM
Hello Ivan,

 The application themes are set in a deferent manner. Only themes, set directly to a control act the way I describled.

Greetings,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Ivan Kopcanski
Top achievements
Rank 1
Answers by
Ross Wozniak
Top achievements
Rank 1
Ivan Kopcanski
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or