Home Forums WPF controls Xceed Toolkit Plus for WPF Another AvalonDock newbie question.

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • cvdevol
    Participant
    Post count: 4
    #43772 |

    In my app I am adding LayoutDocuments (each containng a richTextBox) programmatically. I want to display an image in each tab, depending on what kind of file is displayed.

    I define the images thus:

    Dim rtfImage = New Uri(“C:\Users\Kalki\Documents\Visual Studio 2015\Projects\WpfApplication3\Resources\RichText.png”, UriKind.RelativeOrAbsolute)
    Dim txtImage = New Uri(“C:\Users\Kalki\Documents\Visual Studio 2015\Projects\WpfApplication3\Resources\textdoc.png”, UriKind.RelativeOrAbsolute)

    Then I create a new LayoutDocument thus:

    Dim d As New LayoutDocument

    I set the IconSource property thus:

    d.IconSource = New BitmapImage(rtfImage)

    I set the Title and other peroperties, and add the LayoutDocument to the LayoutDocumentPane thus:

    DocumentPane.Children.Add(d)

    Everything is fine except the image doesn’t show up on the tab, although the Title does. I have tried this for all the Themes.

    What am I missing?

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    Try setting the DocumentHeaderTemplate to display the “Iconsource” and the “Title” :

    <xcad:DockingManager.DocumentHeaderTemplate>
    <DataTemplate>
    <StackPanel Orientation=”Horizontal”>
    <Image Source=”{Binding IconSource}”
    Margin=”0,0,4,0″ />
    <TextBlock Text=”{Binding Title}” />
    </StackPanel>
    </DataTemplate>
    </xcad:DockingManager.DocumentHeaderTemplate>

    The default DocumentHeaderTemplate only displays the “Title”.

    cvdevol
    Participant
    Post count: 4

    Thanks yet again! This works.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.