예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
 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;
     }
 }
예제 #4
0
 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;
 }
예제 #7
0
 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;
 }
예제 #9
0
 private static ImageSource GetIcon(DbMapper.TreeItem _, RowPresenter p)
 {
     return(p.GetValue(_.Node).Kind.GetIcon(p.IsExpanded));
 }
예제 #10
0
        private bool IsMatched(RowPresenter row)
        {
            var nodeInfo = row.GetValue(_.TreeNode);

            return(_marker.Matches(nodeInfo));
        }
예제 #11
0
            private string GetNameFormatString(RowPresenter p)
            {
                var kind = p.GetValue(_.Node).Kind;

                return(kind == ModelMapper.NodeKind.Model ? UserMessages.ModelPresenter_ModelNameFormat : null);
            }