It has something to do with using the controls out of a DLL, like its not using the Generic.xaml in the DLL...The below test control works fine if it is in the Application and using the apps generic.xaml to merged dictionaries. But if I move the control, the template, and the merged dictionary to the DLL, it compiles and all, but I do not see the control in the app then.Test.Theme.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:inputToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:SDL.ArcGIS.Client.Toolkit">
<!-- Dialog Window Style -->
<Style TargetType="local:Test">
<!-- Existing Properties -->
<Setter Property="Width" Value="Auto" />
<Setter Property="Height" Value="Auto" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Background" Value="#BBAF1E2D" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Verdana" />
<Setter Property="FontWeight" Value="Bold" />
<!-- Template -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:Test">
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<TextBlock Text="Test Control" Foreground="{TemplateBinding BorderBrush}" VerticalAlignment="Center" Margin="0,0,5,0" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Test.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Data;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
namespace SDL.ArcGIS.Client.Toolkit
{
public class Test : Control
{
//Constructors
public Test()
{
#if SILVERLIGHT
this.DefaultStyleKey = typeof(Test);
#endif
}
static Test()
{
#if !SILVERLIGHT
DefaultStyleKeyProperty.OverrideMetadata(typeof(Test), new FrameworkPropertyMetadata(typeof(Test)));
#endif
}
//Methods
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
}
}
}
Generic.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SDL.ArcGIS.Client.Toolkit">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Titlebar/Splitter.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Titlebar/Titlebar.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Toolbar/Toolbar.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Windows/AccordionWindow.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Windows/DialogWindow.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Table Of Contents/TableOfContents.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Grid Splitter/MapDataSplitter.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Grid Splitter/MapDataTabControl.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Bookmark/Bookmark.Theme.xaml" />
<ResourceDictionary Source="/SDL.ArcGIS.Client.Toolkit;component/Test/Test.Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
Thanks for the help!