Note: Implementing these view classes as UserControls does solve this issue but UserControls come with their own baggage. Among other issues and annoyances, UserControls cannot be nested. So I'm looking for a solution that does not involve UserControl or require xaml/xaml.cs pairs for each view class.
namespace ViewPropertiesTest
{
class MyView : Grid
{
public MyView()
{
this.VerticalAlignment = VerticalAlignment.Bottom;
}
}
}
... and when I drop an instance of it onto my main window, the xaml looks like this:
<local:MyView HorizontalAlignment="Left" VerticalAlignment="Top" Margin="269,176,0,0" Width="100" Height="100"/>
When XAML Designer creates and initializes an instance of the MyView class, is there a virtual method that I can override that the Designer calls to allow me to initialize some properties myself?