public HeatMapControl(HeatMapViewModel viewModel)
        {
            InitializeComponent();

            this.viewModel = viewModel;
            this.DataContext = this.viewModel;

            this.CancellationTokenSource = new CancellationTokenSource();
            this.pendingRefresh = this.PerformUpdateAsync();

            //Register a message to inform this control when the poll interval has updated so that 
            //we can immediately respond to the change
            Messenger.Default.Register<HeatMapPollIntervalUpdatedMessage>(this, 
                (o) =>
                {
                    if (this.viewModel == o.UpdatedViewModel)
                    {
                        this.SleepCancellationTokenSource.Cancel();
                    }
                });
        }
 public HeatMapPollIntervalUpdatedMessage(HeatMapViewModel updatedViewModel)
 {
     this.UpdatedViewModel = updatedViewModel;
 }