It's the code from YouIandReactiveUI
Is there a more elegant way to achieve this? Or is there any way to bind in code with IViewFor?
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<local:TweetMediaAttachmentView ViewModel="{Binding .}"/>
<Button
x:Name="removeButton"
Command="{Binding DataContext.RemoveAttachmentCommand, ElementName=attachmentsItemsControl}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>