Clean up more warnings (#15039)

* These `Icon` bindings were to `Profile`s which aren't Observable, but
it also doesn't matter
* More c# warnings

hopefully we'll just jump straight to real errors now.
This commit is contained in:
Mike Griese
2023-03-24 08:30:58 -05:00
committed by GitHub
parent b34444f40a
commit 36c6b7748e
3 changed files with 27 additions and 28 deletions

View File

@@ -60,7 +60,7 @@
<IconSourceElement Grid.Column="0"
Width="16"
Height="16"
IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
IconSource="{x:Bind Icon, Converter={StaticResource IconSourceConverter}}" />
<TextBlock Grid.Column="1"
Text="{x:Bind Name}" />

View File

@@ -57,7 +57,7 @@
<IconSourceElement Grid.Column="0"
Width="16"
Height="16"
IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
IconSource="{x:Bind Icon, Converter={StaticResource IconSourceConverter}}" />
<TextBlock Grid.Column="1"
Text="{x:Bind Name}" />
@@ -104,7 +104,7 @@
Width="24"
Height="24"
VerticalAlignment="Center"
IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
IconSource="{x:Bind Icon, Converter={StaticResource IconSourceConverter}}" />
<TextBlock Grid.Row="0"
Grid.Column="1"

View File

@@ -8,7 +8,6 @@ namespace Microsoft.Terminal.Wpf
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Interop;
using System.Windows.Media;
@@ -56,30 +55,6 @@ namespace Microsoft.Terminal.Wpf
};
}
/// <summary>
/// WPF's HwndHost likes to mark the WM_GETOBJECT message as handled to
/// force the usage of the WPF automation peer. We explicitly mark it as
/// not handled and don't return an automation peer in "OnCreateAutomationPeer" below.
/// This forces the message to go down to the HwndTerminal where we return terminal's UiaProvider.
/// </summary>
/// <inheritdoc/>
protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == (int)NativeMethods.WindowMessage.WM_GETOBJECT)
{
handled = false;
return IntPtr.Zero;
}
return base.WndProc(hwnd, msg, wParam, lParam, ref handled);
}
/// <inheritdoc/>
protected override AutomationPeer OnCreateAutomationPeer()
{
return null;
}
/// <summary>
/// Event that is fired when the terminal buffer scrolls from text output.
/// </summary>
@@ -274,6 +249,30 @@ namespace Microsoft.Terminal.Wpf
}
}
/// <summary>
/// WPF's HwndHost likes to mark the WM_GETOBJECT message as handled to
/// force the usage of the WPF automation peer. We explicitly mark it as
/// not handled and don't return an automation peer in "OnCreateAutomationPeer" below.
/// This forces the message to go down to the HwndTerminal where we return terminal's UiaProvider.
/// </summary>
/// <inheritdoc/>
protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == (int)NativeMethods.WindowMessage.WM_GETOBJECT)
{
handled = false;
return IntPtr.Zero;
}
return base.WndProc(hwnd, msg, wParam, lParam, ref handled);
}
/// <inheritdoc/>
protected override AutomationPeer OnCreateAutomationPeer()
{
return null;
}
/// <inheritdoc/>
protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)
{