Skip to content

Conversation

@kentcb
Copy link
Contributor

@kentcb kentcb commented Jun 13, 2015

This PR fixes #870 by adding a ViewContract property (of type string) to the ViewModelViewHost implementation on XAML platforms. The idea is to simplify use cases such as:

<ListBox x:Name="listBox">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <rxui:ViewModelViewHost ViewContract="listitem" ViewModel="{Binding .}"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

Previously this would require some pretty ugly hackery to get the appropriate view contract in use by the ViewModelViewHost.

NOTE: I only implemented this for XAML platforms because it seems of higher importance there. Also, I'm not really set up to build other platforms yet so I didn't really want to risk committing broken code.

@anaisbetts
Copy link
Member

Thanks!

anaisbetts added a commit that referenced this pull request Jul 14, 2015
Provide ViewContract property on ViewModelViewHost for XAML platforms
@anaisbetts anaisbetts merged commit 55de868 into reactiveui:rxui7-master Jul 14, 2015
@anaisbetts
Copy link
Member

/cc #850

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants