コンポーネントのラインナップ:Org図表可能条件付き書式

StackOverflow https://stackoverflow.com/questions/69928

  •  09-06-2019
  •  | 
  •  

質問

当社は、従来の複雑な組織構造を定義する金額の水準の文字は'n'ではなく実際の番号です。まエクスプレスの構造監督-選手コメンモノスペース型フォント:

         Alice
 ,--------|-------,------,------,
Bob      Fred    Jack   Kim    Lucy
 |        |      
Charlie  Greg    
Darren   Henry
Eric

誰でも参加でき、無料で入場できない左右対称としてジャック、キム-ルーシーの報告書にはアリスが報告した。

を使用 TreeViewItemsPanel を含む StackPanelOrientation="Horizontal"も簡単に行えま, この結果と非常に大きな TreeView 一度に一人20その他の報告になる。ができ また利用 Triggers のぞき穴かどうか TreeViewItem 子どもと Property="TreeViewItem.HasItems", 出すことができ、同じコンテキストとして記の ItemsPanel. 例:えしましたがるフレッドは報告がないかどうかを報告。

でき条件付形式 TreeViewItems する垂直の場合子供はいないのですか。

役に立ちましたか?

解決 2

まあ、利用のヒントからのリンク先の第るも読んでなかったと思います。

の肉のうち、コンバータ:

<ValueConversion(GetType(ItemsPresenter), GetType(Orientation))> _
Public Class ItemsPanelOrientationConverter
Implements IValueConverter

Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, _
ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) _
As Object Implements System.Windows.Data.IValueConverter.Convert

    'The 'value' argument should reference an ItemsPresenter.'
    Dim itemsPresenter As ItemsPresenter = TryCast(value, ItemsPresenter)
    If itemsPresenter Is Nothing Then
        Return Binding.DoNothing
    End If

    'The ItemsPresenter''s templated parent should be a TreeViewItem.'
    Dim item As TreeViewItem = TryCast(itemsPresenter.TemplatedParent, TreeViewItem)
    If item Is Nothing Then
        Return Binding.DoNothing
    End If

    For Each i As Object In item.Items
        Dim element As StaffMember = TryCast(i, StaffMember)
        If element.IsManager Then
            'If this element has children, then return Horizontal'
            Return Orientation.Horizontal
        End If
    Next

    'Must be a stub ItemPresenter'
    Return Orientation.Vertical

End Function

を取得しい消費スタイルでの作用の可能:

    <Setter Property="ItemsPanel">
        <Setter.Value>
            <ItemsPanelTemplate >
                <ItemsPanelTemplate.Resources>
                    <local:ItemsPanelOrientationConverter x:Key="conv" />
                </ItemsPanelTemplate.Resources>
                <StackPanel IsItemsHost="True" 
                            Orientation="{Binding   
                            RelativeSource={x:Static RelativeSource.TemplatedParent}, 
                            Converter={StaticResource conv}}" />
            </ItemsPanelTemplate>
        </Setter.Value>
    </Setter>

他のヒント

ジ-スミスはexcecllent CodeProject条約が可能.読んで こちらの

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top