示例#1
0
        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;
            }
        }
示例#2
0
        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);
        }
示例#3
0
 private static ISearchResult ToSearchResult(ViewItem item)
 {
     return((item?.Data?.Target) as ISearchResult);
 }
示例#4
0
 void IViewModel.OnPinCheckboxClicked(ViewItem item)
 {
     TogglePinnedProperty(item);
 }
示例#5
0
 void IViewModel.OnVisibilityCheckboxClicked(ViewItem item)
 {
     ToggleVisibleProperty(item);
 }