void IViewModel.OnMenuItemClicked(ViewItem viewItem, MenuItemId menuItemId) { switch (menuItemId) { case MenuItemId.Visible: ToggleVisibleProperty(viewItem); break; case MenuItemId.Pinned: TogglePinnedProperty(viewItem); break; case MenuItemId.VisibleOnTimeline: ToggleVisibleOnTimelineProperty(viewItem); break; case MenuItemId.Delete: Delete(viewItem); break; } }
ContextMenuViewData IViewModel.OnContextMenuPopup(ViewItem viewItem) { var ret = new ContextMenuViewData(); var rslt = ToSearchResult(viewItem); if (rslt != null) { ret.VisibleItems = MenuItemId.Pinned | MenuItemId.Delete | MenuItemId.Visible | MenuItemId.VisibleOnTimeline; if (rslt.Pinned) { ret.CheckedItems |= MenuItemId.Pinned; } if (rslt.Visible) { ret.CheckedItems |= MenuItemId.Visible; } if (rslt.VisibleOnTimeline) { ret.CheckedItems |= MenuItemId.VisibleOnTimeline; } } return(ret); }
private static ISearchResult ToSearchResult(ViewItem item) { return((item?.Data?.Target) as ISearchResult); }
void IViewModel.OnPinCheckboxClicked(ViewItem item) { TogglePinnedProperty(item); }
void IViewModel.OnVisibilityCheckboxClicked(ViewItem item) { ToggleVisibleProperty(item); }