Skip to content

Instantly share code, notes, and snippets.

@Slesa
Created May 26, 2011 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Slesa/993413 to your computer and use it in GitHub Desktop.
Save Slesa/993413 to your computer and use it in GitHub Desktop.
Double click in list views
public void Open(UnitRowViewModel viewModel)
{
ScreenManager.ActivateItem(new EditUnitViewModel(viewModel.Id));
}
<Style x:Key="UnitItemStyle" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewCollectionStyle}">
<Setter Property="cal:Message.Attach" Value="[Event MouseDoubleClick] = [Action Open($this)]" />
</Style>
@Slesa
Copy link
Author

Slesa commented May 26, 2011

Do not use the edit command itself, because CanEdit depends on item selection and Open does not

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