private async Task UpdateEyedropperWorkAreaAsync() { if (TargetElement != null) { UIElement content; if (ControlHelpers.IsXamlRootAvailable && XamlRoot != null) { content = XamlRoot.Content; } else { content = Window.Current.Content; } var transform = TargetElement.TransformToVisual(content); var position = transform.TransformPoint(default(Point)); _eyedropper.WorkArea = new Rect(position, new Size(TargetElement.ActualWidth, TargetElement.ActualHeight)); if (ControlHelpers.IsXamlRootAvailable && XamlRoot != null) { _eyedropper.XamlRoot = XamlRoot; } await _eyedropper.UpdateAppScreenshotAsync(); } }
private async void UpdateEyedropperWorkArea() { if (TargetElement != null) { var transform = TargetElement.TransformToVisual(Window.Current.Content); var position = transform.TransformPoint(default(Point)); _eyedropper.WorkArea = new Rect(position, new Size(TargetElement.ActualWidth, TargetElement.ActualHeight)); await _eyedropper.UpdateAppScreenshotAsync(); } }