depenencyproperty

TypeInitilizationException when initalizing a Subclass with a Dependency Property

I have the following simple TextBox subclass, which adds one dependency property (OutputIndex): public class OutputTextBox : TextBox { public OutputTextBox() : base() { } public int OutputIndex { get { return (int)this.GetValue(OutputIndexProperty); } set { this.SetValue(OutputIndexProperty, value); } } ...

WPF - Binding an ObservableCollection Dependency Property within a UserControl

I have a control class DragGrid : Grid { ... } which inherits from the original grid and enables dragging and resizing its child elements. I need to bind a custom DP named WorkItemsProperty to an observable collection of type WorkItem (implements INotifyPropertyChanged). Each element in the grid is bound to a collection item....