2020-12-11 22:34:21 +01:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
// Licensed under the MIT license.
|
|
|
|
|
|
|
|
namespace Microsoft.Terminal.Settings.Editor
|
|
|
|
{
|
|
|
|
// Due to a XAML Compiler bug, it is hard for us to propagate an HWND into a XAML-using runtimeclass.
|
|
|
|
// To work around that, we'll only propagate the HWND (when we need to) into the settings' toplevel page
|
|
|
|
// and use IHostedInWindow to hide the implementation detail where we use IInitializeWithWindow (shobjidl_core)
|
|
|
|
// https://github.com/microsoft/microsoft-ui-xaml/issues/3331
|
|
|
|
interface IHostedInWindow
|
|
|
|
{
|
|
|
|
Boolean TryPropagateHostingWindow(IInspectable i);
|
2021-04-12 18:55:51 +02:00
|
|
|
UInt64 GetHostingWindow();
|
2020-12-11 22:34:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[default_interface] runtimeclass MainPage : Windows.UI.Xaml.Controls.Page, IHostedInWindow
|
|
|
|
{
|
|
|
|
MainPage(Microsoft.Terminal.Settings.Model.CascadiaSettings settings);
|
|
|
|
|
|
|
|
void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings);
|
|
|
|
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Settings.Model.SettingsTarget> OpenJson;
|
|
|
|
|
|
|
|
// Due to the aforementioned bug, we can't use IInitializeWithWindow _here_ either.
|
|
|
|
// Let's just smuggle the HWND in as a UInt64 :|
|
|
|
|
void SetHostingWindow(UInt64 window);
|
|
|
|
}
|
|
|
|
}
|