Пример #1
0
        internal static IEnumerable <MenuItem> SearchControl_GetContextMenuItems(SearchControl sc)
        {
            if (sc.SelectedItems == null || sc.SelectedItems.Count != 1)
            {
                return(null);
            }

            return(from ql in LinksClient.GetForEntity(sc.SelectedItem.Clone(), sc).NotNull()
                   where ql.IsVisible
                   select GetMenuItem(ql));
        }
Пример #2
0
        void LinksWidget_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            Entity ident = e.NewValue as Entity;

            ObservableCollection <QuickLink> links = ident != null && !ident.IsNew ? LinksClient.GetForEntity(ident.ToLiteFat(), Control) : new ObservableCollection <QuickLink>();

            lvQuickLinks.ItemsSource = links;

            if (links.IsNullOrEmpty())
            {
                Visibility = Visibility.Collapsed;
            }
            else
            {
                Visibility = Visibility.Visible;
                if (ForceShow != null && links.Any(a => !a.IsShy))
                {
                    ForceShow();
                }
            }
        }