I am developing a WPF application which uses DirectX for drawing the background and border for my application. I have used a code from here : Using Direct2D with WPF