public override FlyoutBase GetContextMenu(FrameworkElement elem) { if (elem.DataContext is GRRow <BookDisplay> BkRow) { BookDisplay BkDisplay = BkRow.Source; BookType BType = BkDisplay.Entry.Type; Edit.Visibility = Visibility.Collapsed; GotoInfo.Visibility = Visibility.Collapsed; DefaultInfo.Visibility = Visibility.Collapsed; if (BType == BookType.S) { Edit.Visibility = Visibility.Visible; Edit.IsEnabled = BkDisplay.Entry.Id != 0; } if (BType != BookType.L) { GotoInfo.Visibility = Visibility.Visible; DefaultInfo.Visibility = Visibility.Visible; } BrowserBtn.IsEnabled = !string.IsNullOrEmpty(BkDisplay.Entry.Info.OriginalUrl); return(ContextMenu); } return(null); }
public override void StructTable() { if (BkTable != null) { return; } BkTable = new GRTable <BookDisplay>(BookDisplay.GetHeaders()); BkTable.Cell = (i, x) => BkTable.ColEnabled(i) ? ColumnName(BkTable.CellProps[i]) : ""; }
private GRRow <BookDisplay> ToGRRow(Book x) { BookDisplay Bk = new BookDisplay(x); ZoneNameResolver.Instance.Resolve(Bk.Entry.ZoneId, n => Bk.Zone = n); return(new GRRow <BookDisplay>(BkTable) { Source = Bk }); }
virtual protected void SortExp(int ColIndex, int Order) { PropertyInfo Prop = BkTable.CellProps[ColIndex].Property; QueryExp = BookDisplay.QuerySort(Prop, Order); if (QueryExp != null) { BkTable.SortCol(ColIndex, Order); } }