Click here to Skip to main content
15,886,199 members
Articles / Desktop Programming / WPF

Ultrabook Sensors on Desktop App

Rate me:
Please Sign up or sign in to vote.
4.86/5 (4 votes)
5 Jan 2013CPOL7 min read 23.1K   827   8  
Using all Ultrabook sensors on Desktop Application
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace SensorsUltrabook
{
    public abstract class SensorBase : Control
    {
        public static readonly DependencyProperty ReportIntervalProperty = DependencyProperty.Register(
            "ReportInterval",
            typeof (int),
            typeof (SensorBase),
            new PropertyMetadata(DependencyProperty.UnsetValue, ReportIntervalPropertyPropertyChanged));

        public int ReportInterval
        {
            get { return (int) GetValue(ReportIntervalProperty); }
            set { SetValue(ReportIntervalProperty, value); }
        }

        protected abstract void OnReportIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e);

        private static void ReportIntervalPropertyPropertyChanged(DependencyObject d,
                                                                  DependencyPropertyChangedEventArgs e)
        {
            var sender = d as SensorBase;

            sender.OnReportIntervalChanged(d, e);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) NIC
India India
I have more then 5 years of experience in the software development sectors with more then 15 softwares in C#, WPF, SQL SERVER, WCF, LINQ, intel perceptual computing sdk, digital signature, snmp.

Comments and Discussions