This code sample shows how to create a compass custom control and use compass sensor to set it's value, following the MVVM pattern.