Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the sample code to match the actual code #1709

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove the word 'Theme' as it doesn't match the actual sample
  • Loading branch information
AndrewKeepCoding committed Dec 17, 2024
commit 291486b81f3a625d9c2c098d626e03d3dfd61749
28 changes: 15 additions & 13 deletions WinUIGallery/ControlPages/TeachingTipPage.xaml
Original file line number Diff line number Diff line change
@@ -20,19 +20,19 @@
<StackPanel HorizontalAlignment="Left">
<local:ControlExample
CSharpSource="TeachingTip/TeachingTipSample1_cs.txt"
HeaderText="Show a targeted TeachingTip on the Toggle Theme button."
HeaderText="Show a targeted TeachingTip on a button."
XamlSource="TeachingTip/TeachingTipSample1_xaml.txt">
<local:ControlExample.Example>
<Grid>
<Button
x:Name="ThemeButton"
Click="TestButtonClick1"
x:Name="TestButton1"
Click="TestButton1Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip1"
x:Name="TestButton1TeachingTip"
Title="This is the title"
Subtitle="And this is the subtitle"
Target="{x:Bind ThemeButton}">
Target="{x:Bind TestButton1}">
<TeachingTip.IconSource>
<SymbolIconSource Symbol="Refresh" />
</TeachingTip.IconSource>
@@ -48,10 +48,10 @@
<local:ControlExample.Example>
<Grid>
<Button
Click="TestButtonClick2"
Click="TestButton2Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip2"
x:Name="TestButton2TeachingTip"
Title="This is the title"
ActionButtonContent="Action button"
CloseButtonContent="Close button"
@@ -65,22 +65,24 @@

<local:ControlExample
CSharpSource="TeachingTip/TeachingTipSample3_cs.txt"
HeaderText="Show a targeted TeachingTip with hero content on the Toggle Theme button."
HeaderText="Show a targeted TeachingTip with hero content on a button."
XamlSource="TeachingTip/TeachingTipSample3_xaml.txt">
<local:ControlExample.Example>
<Grid>
<Button
x:Name="HeroButton"
Click="TestButtonClick3"
x:Name="TestButton3"
Click="TestButton3Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip3"
x:Name="TestButton3TeachingTip"
Title="This is the title"
PreferredPlacement="Bottom"
Subtitle="And this is the subtitle"
Target="{x:Bind HeroButton}">
Target="{x:Bind TestButton3}">
<TeachingTip.HeroContent>
<Image AutomationProperties.Name="Sunset" Source="/Assets/SampleMedia/sunset.jpg" />
<Image
AutomationProperties.Name="Sunset"
Source="/Assets/SampleMedia/sunset.jpg" />
</TeachingTip.HeroContent>
<TeachingTip.Content>
<TextBlock
12 changes: 6 additions & 6 deletions WinUIGallery/ControlPages/TeachingTipPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -20,19 +20,19 @@ public TeachingTipPage()
this.InitializeComponent();
}

private void TestButtonClick1(object sender, RoutedEventArgs e)
private void TestButton1Click(object sender, RoutedEventArgs e)
{
ToggleThemeTeachingTip1.IsOpen = true;
TestButton1TeachingTip.IsOpen = true;
}

private void TestButtonClick2(object sender, RoutedEventArgs e)
private void TestButton2Click(object sender, RoutedEventArgs e)
{
ToggleThemeTeachingTip2.IsOpen = true;
TestButton2TeachingTip.IsOpen = true;
}

private void TestButtonClick3(object sender, RoutedEventArgs e)
private void TestButton3Click(object sender, RoutedEventArgs e)
{
ToggleThemeTeachingTip3.IsOpen = true;
TestButton3TeachingTip.IsOpen = true;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Button
x:Name="ThemeButton"
Click="TestButtonClick1"
x:Name="TestButton1"
Click="TestButton1Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip1"
x:Name="TestButton1TeachingTip"
Title="This is the title"
Subtitle="And this is the subtitle"
Target="{x:Bind ThemeButton}">
Target="{x:Bind TestButton1}">
<TeachingTip.IconSource>
<SymbolIconSource Symbol="Refresh" />
</TeachingTip.IconSource>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Button
Click="TestButtonClick2"
Click="TestButton2Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip2"
x:Name="TestButton2TeachingTip"
Title="This is the title"
ActionButtonContent="Action button"
CloseButtonContent="Close button"
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Button
x:Name="HeroButton"
Click="TestButtonClick3"
x:Name="TestButton3"
Click="TestButton3Click"
Content="Show TeachingTip" />
<TeachingTip
x:Name="ToggleThemeTeachingTip3"
x:Name="TestButton3TeachingTip"
Title="This is the title"
PreferredPlacement="Bottom"
Subtitle="And this is the subtitle"
Target="{x:Bind HeroButton}">
Target="{x:Bind TestButton3}">
<TeachingTip.HeroContent>
<Image AutomationProperties.Name="Sunset" Source="/Assets/SampleMedia/sunset.jpg" />
<Image
AutomationProperties.Name="Sunset"
Source="/Assets/SampleMedia/sunset.jpg" />
</TeachingTip.HeroContent>
<TeachingTip.Content>
<TextBlock