mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-23 00:17:58 +08:00
63d989cab4
* Deprecate ATL based IPC wrapper library * C# projects now use named pipe server implementations from two_way_pipe_message through the interop C++/Cli library. * Added Unit testing to interop library
37 lines
1.1 KiB
C#
37 lines
1.1 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.Windows;
|
|
using Microsoft.PowerToys.Settings.UI.Views;
|
|
using Microsoft.Toolkit.Wpf.UI.XamlHost;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Runner
|
|
{
|
|
// Interaction logic for MainWindow.xaml.
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
|
|
{
|
|
// Hook up x:Bind source.
|
|
WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
|
|
ShellPage shellPage = windowsXamlHost.GetUwpInternalObject() as ShellPage;
|
|
|
|
if (shellPage != null)
|
|
{
|
|
// send IPC Message
|
|
shellPage.SetDefaultSndMessageCallback(msg =>
|
|
{
|
|
Program.GetTwoWayIPCManager().Send(msg);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|