terminal/src/cascadia/TerminalApp/TerminalPage.xaml
Mike Griese d5d2b7727f
Warn the user if the keyboard service is disabled (#8095)
## Summary of the Pull Request

![kb-service-disabled](https://user-images.githubusercontent.com/18356694/97578533-eb792d80-19be-11eb-9b13-b771327a72a0.png)

With this PR, the Terminal will check to make sure the "Touch, Keyboard and Handwriting Panel Service" is enabled at startup. If it isn't, then the Terminal won't be able to receive keyboard input (see #4448 and the 20 linked issues to that one).

## References

* See #4448 for more details

## PR Checklist
* [x] Closes #7886 
* [ ] Should this make #4448 not-open as well?
* [x] I work here
* [n/a] Tests added/passed
* [x] Docs: https://github.com/MicrosoftDocs/terminal/pull/168

## Validation Steps Performed

I manually set the service to "Disabled", restarted the machine, verified the dialog opens (and that I'm unable to type in the Terminal), then re-set the service to automatic and rebooted, and the dialog doesn't appear.
2020-11-04 21:44:53 +00:00

107 lines
4 KiB
XML

<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See LICENSE in the project root for license information. -->
<Page
x:Class="TerminalApp.TerminalPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TerminalApp"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="Root" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<local:TabRowControl x:Name="TabRow" Grid.Row="0" />
<Grid x:Name="TabContent" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
<ContentDialog
x:Load="False"
x:Name="AboutDialog"
x:Uid="AboutDialog"
DefaultButton="Close">
<StackPanel Orientation="Vertical">
<TextBlock IsTextSelectionEnabled="True">
<Run Text="{x:Bind ApplicationDisplayName}" /> <LineBreak />
<Run x:Uid="AboutDialog_VersionLabel" />
<Run Text="{x:Bind ApplicationVersion}" />
</TextBlock>
<HyperlinkButton
x:Uid="AboutDialog_DocumentationLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125416" />
<HyperlinkButton
x:Uid="AboutDialog_ReleaseNotesLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125417" />
<HyperlinkButton
x:Uid="AboutDialog_PrivacyPolicyLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125418" />
<HyperlinkButton
x:Uid="AboutDialog_ThirdPartyNoticesLink"
Click="_ThirdPartyNoticesOnClick" />
</StackPanel>
</ContentDialog>
<ContentDialog
x:Load="False"
x:Name="CloseAllDialog"
x:Uid="CloseAllDialog"
DefaultButton="Primary"
PrimaryButtonClick="_CloseWarningPrimaryButtonOnClick"
CloseButtonClick="_CloseWarningCloseButtonOnClick">
</ContentDialog>
<ContentDialog
x:Load="False"
x:Name="MultiLinePasteDialog"
x:Uid="MultiLinePasteDialog"
DefaultButton="Primary">
</ContentDialog>
<ContentDialog
x:Load="False"
x:Name="LargePasteDialog"
x:Uid="LargePasteDialog"
DefaultButton="Primary">
</ContentDialog>
<ContentDialog
x:Load="False"
x:Name="CouldNotOpenUriDialog"
x:Uid="CouldNotOpenUriDialog"
DefaultButton="Primary">
<TextBlock IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords">
<Run x:Name="CouldNotOpenUriReason" /> <LineBreak />
<Run
x:Name="UnopenedUri"
FontFamily="Cascadia Mono">
</Run>
</TextBlock>
</ContentDialog>
<ContentDialog
x:Load="False"
x:Name="KeyboardServiceDisabledDialog"
x:Uid="KeyboardServiceDisabledDialog"
DefaultButton="Primary">
<TextBlock
Foreground="{ThemeResource ErrorTextBrush}"
IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords"
Text="{x:Bind KeyboardServiceDisabledText, Mode=OneWay}" />
</ContentDialog>
<local:CommandPalette
x:Name="CommandPalette"
Grid.Row="1"
Visibility="Collapsed"
VerticalAlignment="Stretch" />
</Grid>
</Page>