private void KeyUp(global::Windows.UI.Core.CoreWindow sender, global::Windows.UI.Core.KeyEventArgs e) { if (e.VirtualKey == VirtualKey.Control) { isCtrlKeyPressed = true; } }
private void KeyDown(global::Windows.UI.Core.CoreWindow sender, global::Windows.UI.Core.KeyEventArgs e) { char k = (char)0; if (e.VirtualKey == VirtualKey.Control) { this.isCtrlKeyPressed = true; } else if (isCtrlKeyPressed) { switch (e.VirtualKey) { case VirtualKey.X: OnInteractionOccured(new InteractionEventArgs(InteractionType.Exit)); break; } } if (e.VirtualKey >= VirtualKey.Number0 && e.VirtualKey <= VirtualKey.Number9) { k = (char)('0' + e.VirtualKey - VirtualKey.Number0); } if (e.VirtualKey >= VirtualKey.NumberPad0 && e.VirtualKey <= VirtualKey.NumberPad9) { k = (char)('0' + e.VirtualKey - VirtualKey.NumberPad0); } OnInteractionOccured(new InteractionEventArgs(InteractionType.KeyPress) { Key = k == 0 ? e.VirtualKey.ToString() : k.ToString() }); }
/// <summary> /// Fired when a key is up on the main window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CoreWindow_KeyUp(global::Windows.UI.Core.CoreWindow sender, global::Windows.UI.Core.KeyEventArgs e) { if (e.VirtualKey == global::Windows.System.VirtualKey.Control) { m_isControlKeyDown = false; } else if (e.VirtualKey == global::Windows.System.VirtualKey.Escape) { // If we have an escape key hit fire go back. m_onGoBackActivation.Raise(this, new EventArgs()); } }
/// <summary> /// Fired when a key is pressed down on the main window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CoreWindow_KeyDown(global::Windows.UI.Core.CoreWindow sender, global::Windows.UI.Core.KeyEventArgs e) { if (e.VirtualKey == global::Windows.System.VirtualKey.Control) { m_isControlKeyDown = true; } else if (m_isControlKeyDown) { // I had this on the key down event but it didn't seem to fire 100% // reliably. So this place seems to work better. if (e.VirtualKey == global::Windows.System.VirtualKey.S) { // Disable for mobile, for some reason this can trip with the mobile keyboard. if (DeviceHelper.CurrentDevice() != DeviceTypes.Mobile) { // Fire the event m_onQuickSearchActivation.Raise(this, new EventArgs()); e.Handled = true; } } } }
public static global::Windows.Graphics.Holographic.HolographicSpace CreateForCoreWindow(global::Windows.UI.Core.CoreWindow window) { throw new global::System.NotImplementedException("The member HolographicSpace HolographicSpace.CreateForCoreWindow(CoreWindow window) is not implemented in Uno."); }
public void SetWindow(global::Windows.UI.Core.CoreWindow window) { global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.FrameworkView", "void FrameworkView.SetWindow(CoreWindow window)"); }
private async void CoreWindow_KeyDown(global::Windows.UI.Core.CoreWindow sender, global::Windows.UI.Core.KeyEventArgs args) { var ctrl = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control); if (ctrl.HasFlag(CoreVirtualKeyStates.Down) && args.VirtualKey == VirtualKey.T) { if (!isResized) { originalHeight = SampleContainer.ActualHeight; originalWidth = SampleContainer.ActualWidth; SampleContainer.Height = 600; SampleContainer.Width = 800; isResized = true; return; } var layoutRoot = new Grid(); var mapViewImage = new Image() { VerticalAlignment = VerticalAlignment.Top }; var uiImage = new Image(); // Create image from the non-map UI var uiLayerImage = await CreateBitmapFromElement(SampleContainer.Content as UIElement); // Find mapview from the sample. This expects that we use the same name in all samples var mapview = (SampleContainer.Content as UserControl).FindName("MyMapView") as MapView; // Retrieve general transform var tranform = mapview.TransformToVisual((SampleContainer.Content as UIElement)); // Retrieve the point value relative to the child. var currentPoint = tranform.TransformPoint(new Point(0, 0)); // Setup the location where the mapview was in the view to respect the ui layout mapViewImage.Margin = new Thickness(currentPoint.X, currentPoint.Y, 0, 0); // Create snapshot from MapView var exportImage = await mapview.ExportImageAsync(); // Set sources to the images and add them to the layout uiImage.Source = uiLayerImage; mapViewImage.Source = await esriUI.RuntimeImageExtensions.ToImageSourceAsync(exportImage); layoutRoot.Children.Add(mapViewImage); layoutRoot.Children.Add(uiImage); // Add layout to the view var sample = SampleContainer.Content; SampleContainer.Content = layoutRoot; // Wait that images are rendered await Task.Delay(TimeSpan.FromSeconds(1)); // Save image to the disk var combinedImage = await CreateBitmapFromElement(SampleContainer.Content as UIElement); await SaveBitmapToFileAsync(combinedImage, SampleManager.Current.SelectedSample.SampleName); // Reset view SampleContainer.Content = sample; SampleContainer.Height = originalHeight; SampleContainer.Width = originalWidth; isResized = false; } }