We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SetIcon Does Nothing

Thread ID:





129328 Mar 13,2017 04:24 PM UTC Mar 15,2017 12:52 PM UTC WPF 5
Tags: DockingManager
Wesley Witt
Asked On March 13, 2017 04:24 PM UTC

I am trying to get an icon set in the header of my docked windows. After calling SetIcon there is no icon displayed in the header. Is there some other property i need to set?

Here is what I'm going:

        <syncfusion:DockingManager Margin="0" Grid.Row="2" x:Name="dockingManager" />

        private Brush CreateImageBrush(string imageName)
            ImageBrush brush = new ImageBrush();
            BitmapImage bi = new BitmapImage();
            StreamResourceInfo sri = System.Windows.Application.GetResourceStream(new Uri(imageName, UriKind.RelativeOrAbsolute));
            bi.StreamSource = sri.Stream;
            brush.ImageSource = bi;
            return brush;

        private void CreateNewDockWindow(System.Windows.Controls.ContentControl window, string headerText, string imageName, DockSide side)
            DockingManager.SetState(window, DockState.Dock);
            DockingManager.SetSide(window, side, DockState.Dock);
            DockingManager.SetHeader(window, headerText);
            DockingManager.SetIcon(window, this.CreateImageBrush(imageName));

Wesley Witt
Replied On March 13, 2017 08:33 PM UTC

Here is a simple app that shows the problem.

Attachment: WpfApp1_b8a27c94.zip

Marimuthu Sivalingam [Syncfusion]
Replied On March 14, 2017 11:37 AM UTC

Hi Wesley,

Thank you for contacting Syncfusion Support.

We have checked the reported query in your updated sample. We can use SetIcon attached property of DockingManager in Document and Tabbed dock windows only. So, we have prepared the sample to meet your requirement. In this sample, we have edited the HeaderTemplate of DockingManager to set Icon for Dock window. Please find the sample from the following link.

Sample: WpfApp1

Marimuthu S

Wesley Witt
Replied On March 14, 2017 02:18 PM UTC

Thanks for the response.

In looking at the code you posted I see that it does not do exactly the same thing as my code. Specifically the icon is set statically in the xaml. My requirement is to set the icon dynamically via code when the window is created. If the icon is set in the xaml as you provided then every window would have the same icon. I want to have different icons for different windows. I removed the image source from the data template but that doesn't work because the seticon() call does not work. 

How can I achieve my requirement of having a different icon based on the window I'm creating? Is it possible to apply different header templates to each window dynamically when it is created?

Wesley Witt
Replied On March 14, 2017 03:08 PM UTC

I was able to add code that dynamically creates the header template with each window creation (see attached file). Works great.

I suggest adding something like this to your samples.

Attachment: WpfApp1dynamic_48e3f472.zip

Marimuthu Sivalingam [Syncfusion]
Replied On March 15, 2017 12:52 PM UTC

Hi Wesley,

Thank you for your valuable suggestion. Please let us know if you need any further assistance, we will be happy to assist you.

Marimuthu S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon