Skip to content

Commit eef715d

Browse files
committed
Add About flyout
1 parent 4f31d4b commit eef715d

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

ZuneModdingHelper/MainWindow.xaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@
99
mc:Ignorable="d"
1010
Title="Zune Modding Helper" Height="450" Width="800"
1111
Loaded="Window_Loaded">
12+
13+
<mah:MetroWindow.RightWindowCommands>
14+
<mah:WindowCommands>
15+
<Button Style="{StaticResource MahApps.Styles.Button.WindowCommands}" Click="AboutButton_Click">
16+
<mah:FontIcon Glyph="&#xE946;" FontFamily="Segoe MDL2 Assets"/>
17+
</Button>
18+
</mah:WindowCommands>
19+
</mah:MetroWindow.RightWindowCommands>
20+
21+
<mah:MetroWindow.Flyouts>
22+
<mah:FlyoutsControl>
23+
<mah:Flyout x:Name="AboutFlyout" Header="About" Position="Right">
24+
<TextBlock FontSize="14" Padding="16" TextWrapping="Wrap">
25+
<Run Text="Zune Modding Helper" FontWeight="Bold" FontSize="16"/><LineBreak/>
26+
<Run Text="2021.4.26-alpha"/><LineBreak/>
27+
<Hyperlink NavigateUri="https://github.com/yoshiask/ZuneModdingHelper" RequestNavigate="Link_RequestNavigate">
28+
<Run Text="View source"/>
29+
</Hyperlink><LineBreak/>
30+
<Hyperlink NavigateUri="https://github.com/yoshiask/ZuneModdingHelper/releases" RequestNavigate="Link_RequestNavigate">
31+
<Run Text="View releases"/>
32+
</Hyperlink><LineBreak/><LineBreak/>
33+
<Run Text="Developed by Joshua &quot;Yoshi&quot; Askharoun." FontWeight="SemiBold"/>
34+
<Run Text="Mods included with authors' permission."/><LineBreak/><LineBreak/>
35+
<Run Text="I am not liable for any damages caused directly or indirectly by this tool or any of the mods it contains."/>
36+
</TextBlock>
37+
</mah:Flyout>
38+
</mah:FlyoutsControl>
39+
</mah:MetroWindow.Flyouts>
40+
1241
<Grid>
1342
<Grid.RowDefinitions>
1443
<RowDefinition Height="*"/>

ZuneModdingHelper/MainWindow.xaml.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using OwlCore.AbstractUI.ViewModels;
55
using System;
66
using System.Collections.Generic;
7+
using System.Diagnostics;
78
using System.Linq;
89
using System.Text;
910
using System.Threading.Tasks;
@@ -123,5 +124,20 @@ private async void ModResetButton_Click(object sender, RoutedEventArgs e)
123124
await this.ShowMessageAsync("Completed", $"Successfully reset '{mod.Title}'", settings: defaultMetroDialogSettings);
124125
}
125126
}
127+
128+
private void AboutButton_Click(object sender, RoutedEventArgs e)
129+
{
130+
AboutFlyout.Width = Math.Max(Math.Min(500, ActualWidth), ActualWidth / 3);
131+
AboutFlyout.IsOpen = true;
132+
}
133+
134+
private void Link_RequestNavigate(object sender, RequestNavigateEventArgs e)
135+
{
136+
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)
137+
{
138+
UseShellExecute = true
139+
});
140+
e.Handled = true;
141+
}
126142
}
127143
}

0 commit comments

Comments
 (0)