mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
* Set up KBM WinUI3 Editor UI project * Test invoking the KBM library via wrapper for WinUI3 C# UI * Set up Editor Library Wrapper and enable logging * fix spelling * update spacing and remove unused file * fix formatting * update sln * update wrapper project config * import common props * update UI reference * gate the new editor with the experimentation toggle in settings
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices.WindowsRuntime;
|
|
using Microsoft.UI.Xaml;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
|
using Microsoft.UI.Xaml.Data;
|
|
using Microsoft.UI.Xaml.Input;
|
|
using Microsoft.UI.Xaml.Media;
|
|
using Microsoft.UI.Xaml.Navigation;
|
|
using Windows.Foundation;
|
|
using Windows.Foundation.Collections;
|
|
|
|
namespace KeyboardManagerEditorUI
|
|
{
|
|
/// <summary>
|
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
|
/// </summary>
|
|
public sealed partial class MainWindow : Window
|
|
{
|
|
[DllImport("KeyboardManagerEditorLibraryWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
private static extern bool CheckIfRemappingsAreValid();
|
|
|
|
public MainWindow()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
private void MyButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
// Call the C++ function to check if the current remappings are valid
|
|
myButton.Content = CheckIfRemappingsAreValid() ? "Valid" : "Invalid";
|
|
}
|
|
}
|
|
}
|