Skip to content

Commit

Permalink
加入About頁面
Browse files Browse the repository at this point in the history
  • Loading branch information
Flier committed Jul 26, 2018
1 parent 7764a14 commit ac174bb
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ConvertZZ/ConvertZZ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
<DependentUpon>Page_File.xaml</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
<Compile Include="Window_About.xaml.cs">
<DependentUpon>Window_About.xaml</DependentUpon>
</Compile>
<Compile Include="Window_DialogHost.xaml.cs">
<DependentUpon>Window_DialogHost.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -147,6 +150,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Window_About.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Window_DialogHost.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
1 change: 1 addition & 0 deletions ConvertZZ/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
</MenuItem>
<MenuItem Uid="1" Header="隱藏/顯示懸浮球" Click="MenuItem_Click"/>
<MenuItem Header="Setting" Click="Setting_Click"/>
<MenuItem Header="About" Click="About_Click"/>
<MenuItem Header="Exit" Click="Exit_Click"/>
</ContextMenu>
</Window.Resources>
Expand Down
8 changes: 6 additions & 2 deletions ConvertZZ/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ private void Window_MouseDown(object sender, MouseButtonEventArgs e)
this.DragMove();
}
}
private void About_Click(object sender, RoutedEventArgs e)
{
Window_About window_About = new Window_About();
window_About.ShowDialog();
}
private void Setting_Click(object sender, RoutedEventArgs e)
{
UnRegAllHotkey();
Expand All @@ -101,8 +106,7 @@ private void Exit_Click(object sender, RoutedEventArgs e)
App.nIcon.Visible = false;
App.nIcon.Dispose();
Environment.Exit(0);
}

}
private void Window_MouseUp(object sender, MouseButtonEventArgs e)
{
ContextMenu NotifyIconMenu = (ContextMenu)this.FindResource("NotifyIconMenu");
Expand Down
26 changes: 26 additions & 0 deletions ConvertZZ/Window_About.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Window x:Class="ConvertZZ.Window_About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="About" MinHeight="200" MinWidth="350" ResizeMode="NoResize" Topmost="True" SizeToContent="WidthAndHeight">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<Grid Width="100" Height="150" MouseUp="Label_MouseUp">
<Grid.Background>
<ImageBrush ImageSource="icon.ico" Stretch="Uniform"/>
</Grid.Background>
</Grid>
<Label Content="ConvertZZ" FontSize="40" FontFamily="Arial" VerticalAlignment="Center" MouseUp="Label_MouseUp"/>
</StackPanel>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="Make by flier268" HorizontalAlignment="Left"/>
<Label Content="GPL-3.0 Licence" Grid.Column="1" HorizontalAlignment="Right" Margin="0"/>
</Grid>
</StackPanel>
</Window>
22 changes: 22 additions & 0 deletions ConvertZZ/Window_About.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;

namespace ConvertZZ
{
/// <summary>
/// Window_About.xaml 的互動邏輯
/// </summary>
public partial class Window_About : Window
{
public Window_About()
{
InitializeComponent();
}

private void Label_MouseUp(object sender, MouseButtonEventArgs e)
{
Process.Start("https://github.com/flier268/ConvertZZ");
}
}
}

0 comments on commit ac174bb

Please sign in to comment.