I created a class that inherits from Window and has got a DependencyProperty called TitlebarContent.
public FrameworkElement TitleBarContent
{
get { return (FrameworkElement)GetValue(TitleBarContentProperty); }
set { SetValue(TitleBarContentProperty, value); }
}
// Using a DependencyProperty as the backing store for TitleBarContent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TitleBarContentProperty =
DependencyProperty.Register("TitleBarContent", typeof(FrameworkElement), typeof(tkWindowControl), new PropertyMetadata(default(FrameworkElement)));
Inside a ResourceDictionary for Styles i add a ContentControlfor this property.
Now I'd like to use the new 'WindowObject' in another application and access the new TitlebarContentProperty. I can see the items inside my Titlebar and I'm able to move the Window, resize it and more. But I cannot bind to these items. For example I'd like to add a Helpbutton inside the Titlebar. The Button is shown, but i can't click it.
<tk:tkWindowControl.TitleBarContent>
<DockPanel Grid.Row="0" FlowDirection="LeftToRight">
<Button Content="Exit" Command="{Binding ExitApplicationCommand}" Height="60" Width="60" Background="Red"/>
</DockPanel>
</tk:tkWindowControl.TitleBarContent>
My DependencyProperty is a typeof(FrameWorkElement) because i like to add several Buttons to the Titlebar.
Is it possible to use my Bindings in this way?
Titlebarcontentthe Button has noIsMouseOverEffect and theBindingdoesn't work anymore.