Я создал собственный элемент управления:
Код: Выделить всё
public class CustomControl
{
// Dependency Properties
public int MyProperty
{
get { return (int)GetValue(MyPropertyProperty); }
set { SetValue(MyPropertyProperty, value); }
}
// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MyPropertyProperty =
DependencyProperty.Register("MyProperty", typeof(int), typeof(MainViewModel), new PropertyMetadata(0));
}
Код: Выделить всё
public CustomControl CustomControl { get; set; }
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/152 ... t-property