This is a migrated thread and some comments may be shown as answers.

Icon for RadWindow

2 Answers 402 Views
Window
This is a migrated thread and some comments may be shown as answers.
David Parvin
Top achievements
Rank 1
David Parvin asked on 21 Jul 2010, 07:11 PM
I have replaced several of my dialog forms with RadWindow form in my WPF application and the Application Icon that used to show on the dialogs don't seem to show on the RadWindow.  I have tried a lot of different ways of getting the Icon to show including the following:

 

if (((System.Windows.Controls.Canvas)this.Parent).Parent is Window)
{
    Window thisWindow = ((System.Windows.Controls.Canvas)this.Parent).Parent as Window;
    thisWindow.ShowInTaskbar = true;
    thisWindow.Title = this.Header.ToString();
    this.Icon = thisWindow.Icon;
}  

The Icon shows in the taskbar correctly, but nothing is shown on the RadWindow itself.  Is there something I am doing wrong?  Some setting someplace that I am missing that will make it magically show it?

I tried:
Uri iconUri = new Uri("pack://application:,,,/WPFIcon2.ico", UriKind.RelativeOrAbsolute);
this.Icon = BitmapFrame.Create(iconUri);

and I get the text "pack://application:,,,/WPFIcon2.ico" where the Icon should be.

I even tried creating a System.Drawing.Icon object and setting it to that and it just puts  "(Icon)" in the corner of the form.

I have nothing in the XAML that refers to the Icon property for the window.  I assumed that the RadWindow type would automatically get the icon from the application, but I have not found any setting on the control that turns on or off the displaying of the icon.

 

2 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 22 Jul 2010, 02:46 PM
Hi David,

Thank you for contacting us.

You can try setting the IconTemplate property of the RadWindow. You can find an example in this online demo.

Hope this helps. Please feel free to contact us again if you have any other inquiries.

Sincerely yours,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 18 May 2014, 08:28 PM
Would have been nice someone answered this years ago. For future readers I will give the solution.

The RadWindow.Icon is looking for an Image and you're (and I) giving and ImageSource.
So instead you use:
Image img = new Image();
img.Source = BitmapFrame.Create(iconUri);
this.Icon = img;
Tags
Window
Asked by
David Parvin
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Martin
Top achievements
Rank 1
Share this question
or