Elysium extra window elements styling

Dec 31, 2014 at 6:24 PM
I have a problem, trying to style the elysium extra window.

When i change element properties manually, directly in the window XAML, they are set properly, but if i try to use a ResourceDictionary, then the style is taken from the Elysium Extra style. How can i directly change the Elysium Extra style or just override it?
Dec 31, 2014 at 6:30 PM
The problem is that the style of Elysium Extra is loaded after my own styles are loaded, so I have wrong styled elements
Coordinator
Jan 2, 2015 at 10:12 AM
You need to add your own resource dictionary after the Elysium Extra one in your App.xaml file.
Jan 2, 2015 at 11:07 AM
Edited Jan 2, 2015 at 6:41 PM
I have only one resource dictionary in App.xaml, the styles are possibly taken from Theme="Light" field.
It looks like this
<ui:ElysiumApplication x:Class="*********"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ui="http://schemas.extra.com/ui"
                          AccentColor="#ffe8a6"
                          ContrastColor="LightBlue"
                          Theme="Light"
             StartupUri="View/Windows/**********Window.xaml">
    <Application.Resources>
        <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/***********;component/View/Styles/WindowStyles/Resources.xaml" />
                </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</ui:ElysiumApplication>
Coordinator
Jan 20, 2015 at 3:11 PM
The Window is a bit special in WPF, it does not pick up styles automatically. Here is a working code sample. I created a new WPF project and all the files are in the root of the project:

MainWindow.xaml
<ui:Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="http://schemas.extra.com/ui"
           Style="{StaticResource MyWindowStyle}"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
    </Grid>
</ui:Window>
Dictionary.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ui="http://schemas.extra.com/ui">
    <ResourceDictionary.MergedDictionaries>
        <ui:SharedResourceDictionary Source="/Framework.UI;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="MyWindowStyle" BasedOn="{StaticResource {x:Type ui:Window}}" TargetType="ui:Window">
        <Setter Property="Background" Value="LightBlue"/>
        <Setter Property="BorderBrush" Value="Red"/>
    </Style>
</ResourceDictionary>
App.xaml
<ui:ElysiumApplication x:Class="WpfApplication1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ui="http://schemas.extra.com/ui"
             AccentColor="#ffe8a6"
             ContrastColor="LightBlue"
             Theme="Light"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Dictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</ui:ElysiumApplication>
Marked as answer by rehansaeed on 1/20/2015 at 7:12 AM