You can try set the DataContext via d:DesignInstance
with IsDesignTimeCreatable=False
:
Use
d:DesignInstance
for create data bindings at design time for a DataContext that is assigned at run time. To create the data binding, you use the data binding builder to create a special design-time data context and set the DesignInstance to a business object type. DesignInstance is a design-time property.
Example:
<Window.DataContext>
<local:Person />
</Window.DataContext>
<Grid d:DataContext="{d:DesignInstance local:Person, IsDesignTimeCreatable=False}">
<TextBox Width="100"
Height="30"
Text="{Binding Path=Name}" />
</Grid>
In this case, DataContext will not be created in design mode and Text of TextBox
will be empty.