Calling Parent VM in ItemsControl

Topics: Actions & Coroutines, Conventions
Nov 28, 2012 at 6:12 AM

There's this example from the Nuts'n'Bolts series, however it deals with the item being a DataTemplate. I'd like to keep things separate with a viewmodel, which works fine, but apparently not with Actions. How would I do "Remove($dataContext)" if the ItemTemplate were to be a separate View?

<UserControl x:Class="Caliburn.Micro.BubblingAction.ShellView"  
        <ItemsControl x:Name="Items">  
                    <StackPanel Orientation="Horizontal">  
                        <Button Content="Remove"  
                                cal:Message.Attach="Remove($dataContext)" />  
                        <TextBlock Text="{Binding Id}" />  
        <Button Content="Add"  
                cal:Message.Attach="Add" />