How can i specify a designer datacontext for a style, so Resharper finds my properties?

@lhildebrandt’s answer is generally right, but in my case this solution produces errors that totally disable displaying the view in designer. Specifying <d:Style.DataContext> inside <Style> tag helped me.

<Style>
    <d:Style.DataContext>
        <x:Type Type="local:MyTreeItem" />
    </d:Style.DataContext>
    <!--usual setters, triggers, etc.-->
</Style>

In this way d:DataContext can also be specified for controls, and we can provide it interfaces, nested classes and even generics without any errors:
https://stackoverflow.com/a/46637478/5598194

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)