Click here to Skip to main content
15,438,113 members
Articles / Silverlight / Silverlight5
Technical Blog
Posted 25 May 2011


1 bookmarked

Silverlight 5 Window: The Things I Did Not Like

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
25 May 2011CPOL2 min read
Features I'd like to see in future releases of Silverlight 5

In my previous post of yesterday, I discussed about multiple-window support in Silverlight 5 Beta and there I mentioned that though it is a wonderful feature, there are some things that I didn't like. Though it is still in beta, and is currently in the development stage and may be the team is working on it.

Let's read the post to know the points that I didn't like or want in future versions. Those are my personal opinions only and I am looking forward to seeing them implemented in future releases of Silverlight 5.

Point #1

There is no template available to create a Window control. So, we can't create the XAML for it, design and use it. We need to create a UserControl and add it dynamically from code behind. I think there should be a Template to create the Window and option to change the template using Blend or any other designer.


Point #2

If you explore the Window class, you will notice that the class is sealed; that means you cannot inherit the class and create your own Window control.


Point #3

There is a method named Close() but I am really very confused why the Open() method is not present there. We need to use Visibility property to show the Window.

public sealed class Window : DependencyObject
    public Window();
    public double Height { get; set; }
    public double Width { get; set; }
    public double Left { get; set; }
    public double Top { get; set; }
    public bool TopMost { get; set; }
    public bool IsActive { get; }
    public WindowState WindowState { get; [SecuritySafeCritical]
    set; }
    public string Title { get; set; }
    public FrameworkElement Content { get; set; }
    public bool IsVisible { get; }
    public Visibility Visibility { get; set; }
    public WindowStyle WindowStyle { get; set; }
    public bool Activate();
    public void Close();
    public void DragMove();
    public void DragResize(WindowResizeEdge resizeEdge);
    public static Window GetWindow(DependencyObject dependencyObject);
    public event EventHandler<ClosingEventArgs> Closing;

Point #4

Also, the property called "TopMost" is not working. I tried to set the property to "true" and thus it should stay the Window on top of every other Window but unfortunately that is not working too.

Point #5

As mentioned by Vikram in his blog post, if we have a higher Window size than the content, it shows a black background for the portion which is not covered by any content. We both discussed this point a few days ago.

Have a look at the below screenshot where I have a smaller content size (White part) than the actual Window size:


Point #6

If you check the Window class, you will notice that there is no Background property mentioned in the class and hence we can't set the color of the Window background.

Point #7

Did you ever try to set a BorderlessRoundCornersWindow to the new Window class instance? If you add it, you will see the below "ArgumentException" while running the application:


That's all about the findings that I discovered till now, and hope that the Silverlight team will work on these and make them available in future releases.

This article was originally posted at


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Technical Lead
India India

Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog ( and CodeProject.

Books authored:

Connect with Kunal on:

Comments and Discussions

-- There are no messages in this forum --