I am relatively new to WPF, so I apologize if I am missing something basic.
I have a user control where I declare dependency properties named PT1x, PT1y, PT2x, PT2y:
Private _pt1x as double = 9
Public Property PT1x As Double
Get
Return GetValue(PT1xProperty)
End Get
Private Set(ByVal value As Double)
SetValue(PT1xProperty, value)
End Set
End Property
Public Shared ReadOnly PT1xProperty As DependencyProperty = _
DependencyProperty.Register("PT1x", _
GetType(Double), GetType(Tile), _
New FrameworkPropertyMetadata(_pt1x))
etc...
I set the datacontext of the usercontrol in xaml:
DataContext="{Binding RelativeSource={RelativeSource Self}}"
And then bind to the property in xaml:
<Line
X1="{Binding PT1x}" Y1="{Binding PT1y}"
X2="{Binding PT2x}" Y2="{Binding PT2y}"
Stroke="Red"
StrokeThickness="1"
x:Name="HS2" />
This renders a line at runtime, but at design time there is nothing rendered in the designer, in either blend or vs 2010. Is there a way to have it render in the designer?
Thanks!