private void Rectangle_PreviewTouchMove(object sender, TouchEventArgs e)
        {
            var color = GetColorAtPoint((Rectangle)sender,e.GetTouchPoint((Rectangle)sender).Position);
            var rgb = new Rgb(color.R,color.G,color.B);

            var viewModel = (MobileApplicationViewModel)DataContext;
            viewModel.UpdatePatientColor(rgb);
        }
 private void SendColorToHyPrDevice(Rgb color)
 {
     _hyPrDevice.UpdateColor(color);
 }
        private void Rectangle_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var color = GetColorAtPoint((Rectangle)sender,e.GetPosition((Rectangle)sender));
            var rgb = new Rgb(color.R, color.G, color.B);

            var viewModel = (MobileApplicationViewModel)DataContext;
            viewModel.UpdatePatientColor(rgb);
        }
 public void UpdatePatientColor(Rgb rgb)
 {
     SelectedUser.Color = rgb;
     SendColorToHyPrDevice(rgb);
 }