Silverlight Quick Tip: ChildWindow Title Customization

September 24, 2009

Today I discovered nice feature of ChildWindow control in Silverlight 3. I was at client’s location and been asked about the ChildWindow title customization with an icon. I had to admit, that I never tried to put something different than text and immediately looked at the type of Title property. For my surprise I found that the property is an “object”, and assumed that it could behave as a ContentPresenter/ContentControl. After 5 minutes I had the client’s request solved: My code is very simple: <controls:ChildWindow x:Class="DevCorner.Samples.ChildWindow.SampleChildWindow" ...

WPF Quick Tip: How to get WPF Window client area size

September 20, 2009

This time my quick tip will be not about the Silverlight, but about WPF. When you have WPF window, the runtime size of it could be discovered by ActualWidth/ActualHeight properties. In most cases this is enough. But what about the case, when you need to perform some mathematical calculations based on the real size of client area? What is this client area? Well, the second question is really easy one – the client area is the area available to user defined UI (controls, panes, etc.): At the screenshot - client area is...