Hi all.
I have a base C# class (EditorButton) that inherits from Button with a corresponding xaml file set in generics.
I have a derived XAML class from the Editor button and the XAML sets properties in the markup (the content)(Like Delete, Cut, Clear, Duplicate)
When I'm creating a new derived class (Delete) to insert into the editor control, none of the content shows up. (when I look at the properties in the code, everything is null)
The images and properties appear in the XAML editor. I'm stumped and lost as to even properly ask the question.
Here's the essentials of the c# class
[DesignTimeVisible(true)]
public partial class EditorButton : Button
{
public static readonly DependencyProperty IsCheckedProperty;
public bool IsChecked
{
get
{
return (bool)GetValue(EditorButton.IsCheckedProperty);
}
set
{
SetValue(EditorButton.IsCheckedProperty, value);
}
}
static EditorButton()
{
FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(EditorButton),
new FrameworkPropertyMetadata(typeof(EditorButton)));
EditorButton.IsCheckedProperty = DependencyProperty.Register("IsChecked",
typeof(bool),
typeof(EditorButton),
new FrameworkPropertyMetadata(false,
FrameworkPropertyMetadataOptions.AffectsRender));
}
public EditorButton()
{
}
}
The XAML File:
<titan:EditorButton
x:Class="Titan.Controls.EditorClearButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:titan="clr-namespace:Titan.Controls"
Focusable="false" BorderThickness="5">
<Image Name="ClearImage"
Source="/Titan;component/images/Clear.png"
Stretch="None"
SnapsToDevicePixels="True"/>
</titan:EditorButton>