Skip to content

Commit d43f445

Browse files
committed
完善关于此应用页的开发工具列表
1 parent b1d4624 commit d43f445

File tree

8 files changed

+190
-22
lines changed

8 files changed

+190
-22
lines changed

PreLaunchTaskr.GUI.WinUI3/PreLaunchTaskr.GUI.WinUI3.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<None Remove="Controls\IconHyperlinkButton.xaml" />
3030
<None Remove="Views\AboutPage.xaml" />
3131
<None Remove="Views\AttachArgumentPage.xaml" />
32+
<None Remove="Views\BannerPage.xaml" />
3233
<None Remove="Views\BlockArgumentPage.xaml" />
3334
<None Remove="Views\EnvironmentVariablePage.xaml" />
3435
<None Remove="Views\InstalledPackagedProgramListPage.xaml" />
@@ -99,6 +100,9 @@
99100
<None Update="readme.txt">
100101
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
101102
</None>
103+
<Page Update="Views\BannerPage.xaml">
104+
<Generator>MSBuild:Compile</Generator>
105+
</Page>
102106
<Page Update="Views\SettingsPage.xaml">
103107
<Generator>MSBuild:Compile</Generator>
104108
</Page>

PreLaunchTaskr.GUI.WinUI3/PreLaunchTaskr.GUI.WinUI3.csproj.user

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<None Update="App.xaml">
1111
<SubType>Designer</SubType>
1212
</None>
13+
<Page Update="Views\BannerPage.xaml">
14+
<SubType>Designer</SubType>
15+
</Page>
1316
<Page Update="Views\SettingsPage.xaml">
1417
<SubType>Designer</SubType>
1518
</Page>

PreLaunchTaskr.GUI.WinUI3/Views/AboutPage.xaml

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,41 @@
3939

4040
<StackPanel>
4141
<TextBlock Style="{ThemeResource TitleTextBlockStyle}" Text="关于此应用" />
42-
<Image MaxHeight="360" Source="/Assets/PreLaunchTaskrBannerSmallText.png" />
42+
43+
<Image
44+
x:Name="BannerImage"
45+
MaxHeight="360"
46+
Source="/Assets/PreLaunchTaskrBannerSmallText.png"
47+
Tapped="BannerImage_Tapped">
48+
49+
<Image.ContextFlyout>
50+
<MenuFlyout>
51+
<MenuFlyoutSubItem IsEnabled="True" Text="与君初相识">
52+
<MenuFlyoutItem IsEnabled="True" Text="犹如故人归" />
53+
</MenuFlyoutSubItem>
54+
55+
<MenuFlyoutSubItem IsEnabled="True" Text="有朋自远方来">
56+
<MenuFlyoutItem IsEnabled="True" Text="不亦乐乎" />
57+
</MenuFlyoutSubItem>
58+
59+
<MenuFlyoutSubItem IsEnabled="True" Text="青,取之于蓝">
60+
<MenuFlyoutItem IsEnabled="True" Text="而青于蓝" />
61+
</MenuFlyoutSubItem>
62+
63+
<MenuFlyoutSubItem IsEnabled="True" Text="剑阁峥嵘而崔嵬">
64+
<MenuFlyoutItem IsEnabled="True" Text="一夫当关,万夫莫开" />
65+
</MenuFlyoutSubItem>
66+
67+
<MenuFlyoutSubItem IsEnabled="True" Text="千门万户曈曈日">
68+
<MenuFlyoutItem IsEnabled="True" Text="总把新桃换旧符" />
69+
</MenuFlyoutSubItem>
70+
71+
<MenuFlyoutSubItem IsEnabled="True" Text="休对故人思故国">
72+
<MenuFlyoutItem IsEnabled="True" Text="且将新火试新茶" />
73+
</MenuFlyoutSubItem>
74+
</MenuFlyout>
75+
</Image.ContextFlyout>
76+
</Image>
4377
</StackPanel>
4478

4579
<Expander IsExpanded="False">
@@ -67,35 +101,46 @@
67101
</Expander>
68102

69103
<Expander Header="Segoe Fluent 图标字体" IsExpanded="False">
70-
<StackPanel>
104+
<StackPanel Spacing="16">
71105
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind AboutFontIcon}" />
72106

73-
<my:IconHyperlinkButton
74-
Padding="8"
75-
NavigateUri="https://learn.microsoft.com/zh-cn/windows/apps/design/style/segoe-fluent-icons-font"
76-
Text="了解 Segoe Fluent 图标字体">
77-
<my:IconHyperlinkButton.IconSource>
78-
<SymbolIconSource Symbol="Go" />
79-
</my:IconHyperlinkButton.IconSource>
80-
</my:IconHyperlinkButton>
107+
<StackPanel>
108+
<my:IconHyperlinkButton
109+
Padding="8"
110+
NavigateUri="https://learn.microsoft.com/zh-cn/windows/apps/design/style/segoe-fluent-icons-font"
111+
Text="了解 Segoe Fluent 图标字体">
112+
<my:IconHyperlinkButton.IconSource>
113+
<SymbolIconSource Symbol="Go" />
114+
</my:IconHyperlinkButton.IconSource>
115+
</my:IconHyperlinkButton>
116+
117+
<my:IconHyperlinkButton
118+
Padding="8"
119+
NavigateUri="https://aka.ms/SegoeFluentIcons"
120+
Text="下载 Segoe Fluent 图标字体">
121+
<my:IconHyperlinkButton.IconSource>
122+
<SymbolIconSource Symbol="Go" />
123+
</my:IconHyperlinkButton.IconSource>
124+
</my:IconHyperlinkButton>
125+
</StackPanel>
126+
</StackPanel>
127+
</Expander>
81128

129+
<Expander Header="开发工具" IsExpanded="False">
130+
<StackPanel>
82131
<my:IconHyperlinkButton
83132
Padding="8"
84-
NavigateUri="https://aka.ms/SegoeFluentIcons"
85-
Text="下载 Segoe Fluent 图标字体">
133+
NavigateUri="https://visualstudio.microsoft.com/zh-hans/vs/preview/"
134+
Text="Visual Studio 2022 Preview">
86135
<my:IconHyperlinkButton.IconSource>
87136
<SymbolIconSource Symbol="Go" />
88137
</my:IconHyperlinkButton.IconSource>
89138
</my:IconHyperlinkButton>
90-
</StackPanel>
91-
</Expander>
92139

93-
<Expander Header="开发工具" IsExpanded="False">
94-
<StackPanel>
95140
<my:IconHyperlinkButton
96141
Padding="8"
97-
NavigateUri="https://visualstudio.microsoft.com/zh-hans/vs/preview/"
98-
Text="Visual Studio 2022 Preview">
142+
NavigateUri="https://github.com/microsoft/WindowsAppSDK"
143+
Text="Windows App SDK">
99144
<my:IconHyperlinkButton.IconSource>
100145
<SymbolIconSource Symbol="Go" />
101146
</my:IconHyperlinkButton.IconSource>
@@ -104,7 +149,7 @@
104149
<my:IconHyperlinkButton
105150
Padding="8"
106151
NavigateUri="https://github.com/microsoft/microsoft-ui-xaml"
107-
Text="WinUI 3">
152+
Text="Microsoft.UI.Xaml">
108153
<my:IconHyperlinkButton.IconSource>
109154
<SymbolIconSource Symbol="Go" />
110155
</my:IconHyperlinkButton.IconSource>
@@ -136,6 +181,15 @@
136181
<SymbolIconSource Symbol="Go" />
137182
</my:IconHyperlinkButton.IconSource>
138183
</my:IconHyperlinkButton>
184+
185+
<my:IconHyperlinkButton
186+
Padding="8"
187+
NavigateUri="https://www.nuget.org/packages/Microsoft.Data.Sqlite/"
188+
Text="Microsoft.Data.Sqlite">
189+
<my:IconHyperlinkButton.IconSource>
190+
<SymbolIconSource Symbol="Go" />
191+
</my:IconHyperlinkButton.IconSource>
192+
</my:IconHyperlinkButton>
139193
</StackPanel>
140194
</Expander>
141195

PreLaunchTaskr.GUI.WinUI3/Views/AboutPage.xaml.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
using Microsoft.UI.Xaml.Controls;
2+
using Microsoft.UI.Xaml.Media.Animation;
3+
using Microsoft.UI.Xaml.Navigation;
24

5+
using System;
36
using System.IO;
47
using System.Text;
58

@@ -26,6 +29,36 @@ private string AboutFontIcon
2629
get => aboutFontIcon;
2730
}
2831

32+
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
33+
{
34+
ConnectedAnimationService
35+
.GetForCurrentView()
36+
.PrepareToAnimate("forwardAnimation", BannerImage);
37+
38+
base.OnNavigatingFrom(e);
39+
}
40+
41+
protected override void OnNavigatedTo(NavigationEventArgs e)
42+
{
43+
base.OnNavigatedTo(e);
44+
45+
ConnectedAnimationService
46+
.GetForCurrentView()
47+
.GetAnimation("backAnimation")?
48+
.TryStart(BannerImage);
49+
}
50+
51+
private void BannerImage_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e)
52+
{
53+
int r = random.Next();
54+
if (r % 10 == 0 || r % 10 == 1)
55+
{
56+
Frame.Navigate(typeof(BannerPage), null, new SuppressNavigationTransitionInfo());
57+
}
58+
}
59+
60+
private static readonly Random random = new();
61+
2962
private static string readme = null!;
3063

3164
private const string aboutFontIcon =
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Page
3+
x:Class="PreLaunchTaskr.GUI.WinUI3.Views.BannerPage"
4+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="using:PreLaunchTaskr.GUI.WinUI3.Views"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
mc:Ignorable="d">
10+
11+
<Grid>
12+
<Image x:Name="BannerImage" Source="/Assets/PreLaunchTaskrBannerSmallText.png" />
13+
<Button
14+
Click="BackButton_Click"
15+
Height="30"
16+
HorizontalAlignment="Left"
17+
VerticalAlignment="Top"
18+
Style="{ThemeResource TitleBarBackButtonStyle}" />
19+
</Grid>
20+
</Page>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Microsoft.UI.Xaml;
2+
using Microsoft.UI.Xaml.Controls;
3+
using Microsoft.UI.Xaml.Controls.Primitives;
4+
using Microsoft.UI.Xaml.Data;
5+
using Microsoft.UI.Xaml.Input;
6+
using Microsoft.UI.Xaml.Media;
7+
using Microsoft.UI.Xaml.Media.Animation;
8+
using Microsoft.UI.Xaml.Navigation;
9+
10+
using System;
11+
using System.Collections.Generic;
12+
using System.IO;
13+
using System.Linq;
14+
using System.Runtime.InteropServices.WindowsRuntime;
15+
16+
using Windows.Foundation;
17+
using Windows.Foundation.Collections;
18+
19+
namespace PreLaunchTaskr.GUI.WinUI3.Views;
20+
21+
public sealed partial class BannerPage : Page
22+
{
23+
public BannerPage()
24+
{
25+
InitializeComponent();
26+
}
27+
28+
protected override void OnNavigatedTo(NavigationEventArgs e)
29+
{
30+
base.OnNavigatedTo(e);
31+
32+
ConnectedAnimationService
33+
.GetForCurrentView()
34+
.GetAnimation("forwardAnimation")?
35+
.TryStart(BannerImage);
36+
}
37+
38+
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
39+
{
40+
if (e.NavigationMode == NavigationMode.Back)
41+
{
42+
ConnectedAnimationService
43+
.GetForCurrentView()
44+
.PrepareToAnimate("backAnimation", BannerImage);
45+
}
46+
47+
base.OnNavigatingFrom(e);
48+
}
49+
50+
private void BackButton_Click(object sender, object e)
51+
{
52+
Frame.GoBack();
53+
}
54+
}

PreLaunchTaskr.GUI.WinUI3/Views/MultiTabPage.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
HorizontalAlignment="Stretch"
8484
VerticalAlignment="Stretch"
8585
x:FieldModifier="private"
86-
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefault}"
87-
IsNavigationStackEnabled="False" />
86+
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefault}" />
8887
</Grid>
8988
</Page>

PreLaunchTaskr.GUI.WinUI3/Views/MultiTabPage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.UI.Xaml.Data;
55
using Microsoft.UI.Xaml.Input;
66
using Microsoft.UI.Xaml.Media;
7+
using Microsoft.UI.Xaml.Media.Animation;
78
using Microsoft.UI.Xaml.Navigation;
89

910
using PreLaunchTaskr.GUI.WinUI3.Helpers;
@@ -59,7 +60,7 @@ private void TabStrip_SelectionChanged(object sender, SelectionChangedEventArgs
5960
{
6061
if (e.AddedItems.Count == 0 || e.AddedItems[0] is null)
6162
{
62-
ContentFrame.Navigate(typeof(Page));
63+
ContentFrame.Navigate(typeof(Page), null, new SuppressNavigationTransitionInfo());
6364
return;
6465
}
6566

0 commit comments

Comments
 (0)