Skip to content

Commit

Permalink
Using content instead of WindowContent
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoehna committed Apr 10, 2024
1 parent 3336345 commit d50a364
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion common/Windows/SecondaryWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public SecondaryWindow()

// Initialize window content template
_windowTemplate = new(this);
WindowContent = _windowTemplate;
Content = _windowTemplate;

// Register secondary window events handlers
Activated += OnSecondaryWindowActivated;
Expand Down
13 changes: 4 additions & 9 deletions tools/SetupFlow/DevHome.SetupFlow/Views/DevDriveView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,10 @@
The comment tags and the spaces Before the Run tags are necessary so the clickable area
of the hyperlink does not extend to edge of the grid column, and instead stay only over the text.
-->
<Span
xml:space="preserve">
<Run x:Uid="ms-resource:///DevHome.SetupFlow/Resources/DevDriveWindowOnlyOneDevDriveAllowedHeader" /> <!--
--><Hyperlink x:Name="GoToLearnMoreHyperlink"
UnderlineStyle="None"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2226090"><!--
--> <Run x:Uid="ms-resource:///DevHome.SetupFlow/Resources/LearnMore" /> <!--
--></Hyperlink> <!--
--></Span>
<Run x:Uid="ms-resource:///DevHome.SetupFlow/Resources/DevDriveWindowOnlyOneDevDriveAllowedHeader" />
<Hyperlink UnderlineStyle="None" NavigateUri="https://go.microsoft.com/fwlink/?linkid=2226090">
<Run x:Uid="ms-resource:///DevHome.SetupFlow/Resources/LearnMore" />
</Hyperlink>
</TextBlock>
<TextBlock
x:Uid="ms-resource:///DevHome.SetupFlow/Resources/DevDriveWindowLaunchSettingsDisksAndVolumesHeader"
Expand Down
13 changes: 0 additions & 13 deletions tools/SetupFlow/DevHome.SetupFlow/Views/DevDriveView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using DevHome.SetupFlow.ViewModels;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;

namespace DevHome.SetupFlow.Views;

Expand All @@ -15,17 +14,5 @@ public DevDriveView(DevDriveViewModel viewModel)
{
ViewModel = viewModel;
this.InitializeComponent();

this.Loaded += (_, _) =>
{
var option = new FindNextElementOptions();
option.SearchRoot = GoToLearnMoreHyperlink;
// An invisible element above the hyperlink is eating a tab.
// Set IsTabStop to false to prevent users having to double-tab to get to the first
// focusable element.
var focusableElement = FocusManager.FindNextElement(FocusNavigationDirection.Up, option);
focusableElement.SetValue(IsTabStopProperty, false);
};
}
}

0 comments on commit d50a364

Please sign in to comment.