Click here to Skip to main content
15,887,881 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anybody know how to specify d:DataContext in the following resource dictionary?

XML
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d">

    <!-- I wish to set 'd:DataContext="{d:DesignInstance Type=SomeNamespace:SomeViewModel}' for this style, but don't know how -->
    <Style TargetType="{x:Type SomeNamespace:SomeControl}">
        <Setter Property="Y" Value="{Binding Top}"/>
    </Style>
</ResourceDictionary>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900