PC camera capture in WPF application

Sometimes we require PC camera to be captured from within a WPF application. Achieving this is not a daunting task. Few open source  and commercial library are available in the market that help us achieve this.

AForge is one such library. Attached is a sample WPF application using AForge.

Sample WPF application zip

WPFWebCam1

Advertisements

Set Width of Control in CodeBehind in WPF

We faced a small issue where we kept a control on WPF UI. The application was a WPF desktop application.
The width of control was required to be equal to the width of the screen. If width of UI is changed at runtime, the width of control should also increase and decrease according.
ActualWidth property solves ths problem.

WPF UI Automated Unit testing

While working on a WPF application, we created the automated unit tests. Application was developed using MVVM pattern.
Using MS Test we were able to test the Model, View Model but another challenge was how to ensure the binding is correct?
We created a utility which help us test the binding, as well as check the static property of controls used on each UI.
UI and its binding are testable now and are part of Automated unit test!