Skip to content

Commit

Permalink
feat: Support for TeachingTip control
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Mar 6, 2024
1 parent 5deeec2 commit 97e7b29
Show file tree
Hide file tree
Showing 6 changed files with 1,137 additions and 1,198 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Page
<utilities:MUXTestPage
x:Class="UITests.Microsoft_UI_Xaml_Controls.TeachingTipTests.TeachingTipPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utilities="using:MUXControlsTestApp.Utilities"
xmlns:local="using:MUXControlsTestApp"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down Expand Up @@ -275,8 +276,8 @@
<TextBlock Grid.Row="33" Grid.ColumnSpan="2" Text="----------Automation Properties----------" Foreground="Red"/>

<TextBlock Grid.Row="34" Text="AutomationName:" Foreground="Red"/>
<TextBlock Grid.Row="35" Grid.Column="0" Text="{x:Bind TeachingTipInVisualTree.(AutomationProperties.Name), Mode=OneWay}" FontSize="8"/>
<TextBlock Grid.Row="35" Grid.Column="1" Text="{x:Bind TeachingTipInResources.(AutomationProperties.Name), Mode=OneWay}" FontSize="8"/>
<!--<TextBlock Grid.Row="35" Grid.Column="0" Text="{x:Bind TeachingTipInVisualTree.(AutomationProperties.Name), Mode=OneWay}" FontSize="8"/>-->
<!--<TextBlock Grid.Row="35" Grid.Column="1" Text="{x:Bind TeachingTipInResources.(AutomationProperties.Name), Mode=OneWay}" FontSize="8"/>-->
<ComboBox x:Name="AutomationNameComboBox" AutomationProperties.Name="AutomationNameComboBox" Grid.Row="36" SelectedIndex="0">
<ComboBoxItem x:Name="AutomationNameVisualTree">TeachingTipInVisualTree</ComboBoxItem>
<ComboBoxItem x:Name="AutomationNameResources">TeachingTipInResources</ComboBoxItem>
Expand Down Expand Up @@ -610,4 +611,4 @@
</Button>
</Grid>
</Grid>
</Page>
</utilities:MUXTestPage>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
using TeachingTipPlacementMode = Microsoft.UI.Xaml.Controls.TeachingTipPlacementMode;
using SymbolIconSource = Microsoft.UI.Xaml.Controls.SymbolIconSource;
using Uno.UI.Samples.Controls;
using Popup = Windows.UI.Xaml.Controls.Popup;
using MUXControlsTestApp.Utilities;

namespace UITests.Microsoft_UI_Xaml_Controls.TeachingTipTests
{
Expand All @@ -39,7 +41,7 @@ enum TipLocation
}

[Sample("TeachingTip", "WinUI")]
public sealed partial class TeachingTipPage : Page, INotifyPropertyChanged
public sealed partial class TeachingTipPage : MUXTestPage, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
Expand Down Expand Up @@ -98,7 +100,11 @@ private void TeachingTipInVisualTree_Closed(TeachingTip sender, TeachingTipClose
}
}

protected override void OnNavigatedFrom(NavigationEventArgs e)
protected
#if HAS_UNO
internal
#endif
override void OnNavigatedFrom(NavigationEventArgs e)
{
if (testWindowBounds != null && testWindowBounds.IsOpen)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ namespace Microsoft.UI.Xaml.Controls
{
public partial class TeachingTip
{
private bool m_isIdle = true;
private XamlRoot m_xamlRoot;

internal bool m_isIdle = true;
private FrameworkElement m_target;

private Border m_container;
private Popup m_popup;
internal Popup m_popup;
private Popup m_lightDismissIndicatorPopup;
private ContentControl m_popupContentControl;
private UIElement m_rootElement;
Expand All @@ -34,7 +36,7 @@ public partial class TeachingTip
private UIElement m_titleTextBox;
private UIElement m_subtitleTextBox;

private WeakReference<DependencyObject> m_previouslyFocuesElement;
private WeakReference<DependencyObject> m_previouslyFocusedElement;

private KeyFrameAnimation m_expandAnimation;
private KeyFrameAnimation m_contractAnimation;
Expand All @@ -47,7 +49,6 @@ public partial class TeachingTip
private TeachingTipPlacementMode m_currentEffectiveTailPlacementMode = TeachingTipPlacementMode.Auto;
private TeachingTipHeroContentPlacementMode m_currentHeroContentEffectivePlacementMode = TeachingTipHeroContentPlacementMode.Auto;


private Rect m_currentBoundsInCoreWindowSpace = Rect.Empty;
private Rect m_currentTargetBoundsInCoreWindowSpace = Rect.Empty;

Expand Down
Loading

0 comments on commit 97e7b29

Please sign in to comment.