XAML style inheritance

Published 10/31/2014 by Christian
Tags: , ,

This makes the Bar style inherits from Foo

<ResourceDictionary x:Class="Baltz.Styles.Bar"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Foo.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="aKey" BasedOn="{StaticResource StyleInFoo}" TargetType="{x:Type aType}">
        <Setter Property="aTypeProperty" Value="aTypePropertyvalue"/>
    </Style>
</ResourceDictionary>

As always, feel free to comment, or ask.


Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading