private static string GetDisplayText(DirectoryTreeItem _, RowPresenter p) { var result = p.GetValue(_.Path); var depth = p.Depth; if (depth > 0) { result = Path.GetFileName(result); } return(result); }
private bool AnyLookupProjection(RowPresenter row) { var node = row.GetValue(_.Node); if (node.Kind == ModelMapper.NodeKind.Projection && node.Name == LOOKUP_PROJECTION) { return(true); } return(row.IsExpanded ? false : row.Children.Any(AnyLookupProjection)); }
private static void Refresh(TextBlock element, ListItem _, RowPresenter rowPresenter) { element.Text = rowPresenter.GetValue(_.Text); if (rowPresenter.GetValue(_.IsSectionHeader)) { element.Foreground = Brushes.White; element.Background = Brushes.Black; element.Padding = new Thickness(0); element.TextWrapping = TextWrapping.NoWrap; } else { var r = rowPresenter.GetValue(_.BackgroundR); var g = rowPresenter.GetValue(_.BackgroundG); var b = rowPresenter.GetValue(_.BackgroundB); element.Foreground = Brushes.Black; element.Background = new SolidColorBrush(Color.FromArgb(255, r, g, b)); element.Padding = new Thickness(10); element.TextWrapping = TextWrapping.Wrap; } }
private static void Refresh(LargeIconListItemView v, LargeIconListItem _, RowPresenter p) { v.ImageSource = p.GetValue(_.LargeIcon); }
private bool CanSelect(RowPresenter row) { return(row.GetValue(_.Column) != null && row.GetValue(_.Mounter) != null); }
private void RefreshIsEnabled(UIElement v, RowPresenter p) { v.IsEnabled = p.GetValue(_.Column) != null; }
protected override void Setup(PasswordBox view, RowPresenter presenter) { view.Visibility = presenter.GetValue(_isPassword) ? Visibility.Visible : Visibility.Collapsed; }
protected override void Refresh(TextBlock view, RowPresenter presenter) { view.FontWeight = presenter.GetValue(_totalAmt) >= 10000 ? FontWeights.Bold : FontWeights.Normal; }
private static ImageSource GetIcon(DbMapper.TreeItem _, RowPresenter p) { return(p.GetValue(_.Node).Kind.GetIcon(p.IsExpanded)); }
private bool IsMatched(RowPresenter row) { var nodeInfo = row.GetValue(_.TreeNode); return(_marker.Matches(nodeInfo)); }
private string GetNameFormatString(RowPresenter p) { var kind = p.GetValue(_.Node).Kind; return(kind == ModelMapper.NodeKind.Model ? UserMessages.ModelPresenter_ModelNameFormat : null); }