Test Control in Simple Sample
This commit is contained in:
Родитель
6dbff9cdeb
Коммит
6f9314227f
|
@ -22,6 +22,7 @@
|
|||
<local:ToolBoxItem Type="{x:Type Rectangle}" />
|
||||
<local:ToolBoxItem Type="{x:Type Border}" />
|
||||
<local:ToolBoxItem Type="{x:Type CheckBox}" />
|
||||
<local:ToolBoxItem Type="{x:Type local:TestControl}" />
|
||||
</x:Array>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="TestControl.cs" />
|
||||
<Compile Include="ToolboxItem.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace SimpleSample
|
||||
{
|
||||
public class TestControl : Control
|
||||
{
|
||||
public Color TestColor
|
||||
{
|
||||
get { return (Color)GetValue(TestColorProperty); }
|
||||
set { SetValue(TestColorProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TestColorProperty =
|
||||
DependencyProperty.Register("TestColor", typeof(Color), typeof(TestControl), new PropertyMetadata());
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче