Okay, this seems to be very hard, or I am missing something obvious. I want to create reusable WINDOW which will be used all over the products. It means that the control is inside WPF.Controls assembly. Themes/Generic.xaml is not a solution, I need to provide my own code for the window, such as custom message hook, etc.
Here is my code in WPF.Controls.dll:
public class CustomWindow : Window
{
static CustomWindow()
{
DefaultStyleKeyProperty.OverrideMetadata(
typeof(CustomWindow),
new FrameworkPropertyMetadata(typeof(CustomWindow)));
}
Now, in another assembly, I create XAML file and try to use this:
<controls:CustomWindow x:Class="Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPF.Controls;assembly=WPF.Controls"
WindowStartupLocation="CenterScreen">
<TextBlock Text="TESTING" />
</controls:CustomWindow>
What I see: big black screen, nothing else, nothing less(big black rectangle - no caption bar). Can anyone shed some light over this? With a bit of googling, I found that somebody else had same problem, so I guess it's not specific to me.
Disabling hardware rendering doesn't help.