ChildWindow Positioning

Silverlight ChildWindow is centered over the parent control. I have extended ChildWindow to open it at a specific position. Here is a live demo : childwindow-positioning-demo And here is the code : public partial class ChildWindowEx : ChildWindow { Point _pt = new Point(0,0); public ChildWindowEx() { InitializeComponent(); } public ChildWindowEx(Point pt) : this() { _pt = pt; } protected override Size ArrangeOverride(Size finalSize) { Grid grid = Utils.FindChild(this, “ContentRoot”); if (grid != null) { grid.Arrange(new Rect(_pt.X, _pt.Y, grid.DesiredSize.Width, grid.DesiredSize.Height)); return finalSize; } return base.ArrangeOverride(finalSize); } } Visual Studio 2010 Solution : download

WPF – LINQ to SQL Sample

This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from AdventureWorks sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with WPF. This sample demonstrates : LINQ to SQL mapping. WPF ListView Control DataBinding. Displaying images stored in database as varbinary in WPF control. The sample code can be downloaded here : WPF-LINQ to SQL Sample License : Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.