Skip to content

Commit 1f8c0ed

Browse files
committed
Improve UI, Fix bugs and Update Docs
1 parent 6ecb8d1 commit 1f8c0ed

20 files changed

+411
-723
lines changed

HandyDoc.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30804.86
4+
VisualStudioVersion = 16.0.31507.150
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyDoc", "HandyDoc\HandyDoc.csproj", "{A1356F3B-6756-42B8-BBBF-F85F076CDE35}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyDoc", "HandyDoc\HandyDoc.csproj", "{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {65F24549-A006-465D-9677-59D2E794F9ED}
23+
SolutionGuid = {43F6C957-9285-4644-8F52-C72552E55640}
2424
EndGlobalSection
2525
EndGlobal

HandyDoc/App.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Application x:Class="HandyDoc.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:hc="https://handyorg.github.io/handycontrol"
5-
xmlns:ui="http://schemas.modernwpf.com/2019"
6-
xmlns:toolkit="http://schemas.modernwpf.com/toolkit">
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http://schemas.modernwpf.com/toolkit"
4+
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:ui="http://schemas.modernwpf.com/2019"
5+
StartupUri="MainWindow.xaml">
76
<Application.Resources>
87
<ResourceDictionary>
98
<ResourceDictionary.MergedDictionaries>
@@ -14,9 +13,15 @@
1413
<ResourceDictionary x:Key="HighContrast" ui:ThemeDictionary.Key="HighContrast" toolkit:ToolkitThemeDictionary.Key="HighContrast" />
1514
</ui:ThemeResources.ThemeDictionaries>
1615
</ui:ThemeResources>
17-
<ui:XamlControlsResources />
18-
<hc:Theme Name="HandyTheme"/>
16+
<ui:XamlControlsResources/>
17+
<hc:ThemeResources/>
18+
<hc:Theme/>
1919
</ResourceDictionary.MergedDictionaries>
20+
<Style TargetType="ui:AutoSuggestBox">
21+
<Style.Resources>
22+
<Style TargetType="ListView" BasedOn="{StaticResource DefaultListViewStyle}"/>
23+
</Style.Resources>
24+
</Style>
2025
<Geometry x:Key="XamlGeometry">M2 4C0.9069372 4 0 4.9069372 0 6L0 17C0 18.093063 0.9069372 19 2 19L22 19C23.093063 19 24 18.093063 24 17L24 6C24 4.9069372 23.093063 4 22 4L2 4 z M 2 6L22 6L22 17L2 17L2 6 z M 3.0253906 9L4.2949219 11.478516L3 14L4.2617188 14L4.9980469 12.251953L5.7382812 14L7 14L5.703125 11.478516L6.9707031 9L5.7246094 9L4.9960938 10.716797L4.2714844 9L3.0253906 9 z M 8.9121094 9L7.5664062 14L8.6191406 14L8.8769531 13L10.246094 13L10.505859 14L11.566406 14L10.214844 9L8.9121094 9 z M 12 9L12 13.976562L13 13.976562L13 11L14.117188 13.976562L14.876953 13.976562L16 11L16 13.976562L16.998047 13.976562L17 13.976562L17 9L15.542969 9L14.501953 12.599609L13.457031 9L12 9 z M 18 9L18 14L21 14L21 13L19 13L19 9L18 9 z M 9.5605469 10.353516L9.9863281 12L9.1347656 12L9.5605469 10.353516 z</Geometry>
2126
<Geometry x:Key="PaletteGeometry">M12 2C6.241 2 1.6193906 6.8668906 2.0253906 12.712891C2.3923906 18.001891 7.0056406 22 12.306641 22L13 22C14.105 22 15 21.105 15 20L15 17C15 15.895 15.895 15 17 15L20 15C21.105 15 22 14.105 22 13L22 12.306641C22 7.0056406 18.002844 2.3923906 12.714844 2.0253906C12.474844 2.0083906 12.236 2 12 2 z M 12 4C12.19 4 12.381219 4.0065313 12.574219 4.0195312C16.738219 4.3085313 20 7.9486406 20 12.306641L20 13L17 13C14.794 13 13 14.794 13 17L13 20L12.306641 20C7.9486406 20 4.3075312 16.737219 4.0195312 12.574219C3.8635312 10.324219 4.6194375 8.1839219 6.1484375 6.5449219C7.6794375 4.9039219 9.758 4 12 4 z M 12.5 5 A 1.5 1.5 0 0 0 11 6.5 A 1.5 1.5 0 0 0 12.5 8 A 1.5 1.5 0 0 0 14 6.5 A 1.5 1.5 0 0 0 12.5 5 z M 8.5 6 A 1.5 1.5 0 0 0 7 7.5 A 1.5 1.5 0 0 0 8.5 9 A 1.5 1.5 0 0 0 10 7.5 A 1.5 1.5 0 0 0 8.5 6 z M 16.5 7 A 1.5 1.5 0 0 0 15 8.5 A 1.5 1.5 0 0 0 16.5 10 A 1.5 1.5 0 0 0 18 8.5 A 1.5 1.5 0 0 0 16.5 7 z M 6.5 10 A 1.5 1.5 0 0 0 5 11.5 A 1.5 1.5 0 0 0 6.5 13 A 1.5 1.5 0 0 0 8 11.5 A 1.5 1.5 0 0 0 6.5 10 z M 10 14 A 2 2 0 0 0 8 16 A 2 2 0 0 0 10 18 A 2 2 0 0 0 12 16 A 2 2 0 0 0 10 14 z</Geometry>
2227
<Geometry x:Key="InterActivityGeometry">M3 3C1.895 3 1 3.895 1 5L1 17C1 18.105 1.895 19 3 19L8 19L8 21L16 21L16 19L21 19C22.105 19 23 18.105 23 17L23 5C23 3.895 22.105 3 21 3L3 3 z M 3 5L21 5L21 17L3 17L3 5 z M 5 7L5 10L11 10L11 7L5 7 z M 13 7L13 10L19 10L19 7L13 7 z M 5 12L5 15L11 15L11 12L5 12 z M 13 12L13 15L19 15L19 12L13 12 z</Geometry>

HandyDoc/App.xaml.cs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
1-
using HandyControl.Controls;
2-
using HandyControl.Data;
3-
using HandyControl.Themes;
4-
using HandyControl.Tools;
5-
using ModernWpf;
1+
using HandyControl.Themes;
62
using System.Windows;
73

84
namespace HandyDoc
95
{
106
public partial class App : Application
117
{
12-
public App()
8+
internal void UpdateTheme(ApplicationTheme theme)
139
{
14-
GlobalDataHelper<AppConfig>.Init();
15-
}
16-
17-
protected override void OnStartup(StartupEventArgs e)
18-
{
19-
base.OnStartup(e);
20-
var boot = new Bootstrapper();
21-
boot.Run();
22-
UpdateSkin(GlobalDataHelper<AppConfig>.Config.Skin);
23-
}
24-
25-
internal void UpdateSkin(SkinType skin)
26-
{
27-
SharedResourceDictionary.SharedDictionaries.Clear();
28-
ResourceHelper.GetTheme("HandyTheme", Resources).Skin = skin;
29-
30-
ThemeManager.Current.ApplicationTheme = skin == SkinType.Dark ? ApplicationTheme.Dark : ApplicationTheme.Light;
31-
Current.MainWindow?.OnApplyTemplate();
10+
ThemeManager.Current.ApplicationTheme = theme;
11+
ModernWpf.ThemeManager.Current.ApplicationTheme = theme == ApplicationTheme.Light ? ModernWpf.ApplicationTheme.Light : ModernWpf.ApplicationTheme.Dark;
3212
}
3313
}
3414
}

HandyDoc/AppConfig.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

HandyDoc/Bootstrapper.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

HandyDoc/HandyDoc.csproj

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
44
<TargetFramework>net5.0-windows10.0.18362</TargetFramework>
5-
<UseWPF>true</UseWPF>
5+
<UseWPF>true</UseWPF>
66
<AssemblyName>HandyDoc</AssemblyName>
77
<RootNamespace>HandyDoc</RootNamespace>
8-
<Version>1.0.0.0</Version>
8+
<Version>2.0.0.0</Version>
99
<Configurations>Debug;Release</Configurations>
10-
<Copyright>Copyright © Mahdi 2018-2021</Copyright>
11-
<FileVersion>1.0.0.0</FileVersion>
12-
<AssemblyVersion>1.0.0.0</AssemblyVersion>
13-
<SatelliteResourceLanguages>en;fa</SatelliteResourceLanguages>
14-
<LangVersion>latest</LangVersion>
15-
<ApplicationIcon>icon.ico</ApplicationIcon>
16-
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
10+
<Copyright>Copyright © Mahdi Hosseini 2021</Copyright>
11+
<FileVersion>2.0.0.0</FileVersion>
12+
<AssemblyVersion>2.0.0.0</AssemblyVersion>
13+
<LangVersion>latest</LangVersion>
14+
<ApplicationIcon>icon.ico</ApplicationIcon>
15+
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
1716
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
1817
</PropertyGroup>
1918
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -26,19 +25,14 @@
2625
<None Remove="icon.ico" />
2726
</ItemGroup>
2827
<ItemGroup>
29-
<PackageReference Include="HandyControls" Version="3.0.0" />
30-
<PackageReference Include="ModernWpf.Toolkit.UI.Controls.Markdown" Version="0.1.0" />
31-
<PackageReference Include="ModernWpfUis" Version="1.0.0" />
32-
<PackageReference Include="Prism.DryIoc" Version="8.0.0.1909" />
28+
<PackageReference Include="HandyControls" Version="3.3.7" />
29+
<PackageReference Include="ModernWpfUis" Version="1.2.0" />
30+
<PackageReference Include="ModernWpf.Toolkit.UI.Controls.Markdown" Version="0.1.0" />
3331
</ItemGroup>
3432
<ItemGroup>
35-
<Page Include="Properties\DesignTimeResources.xaml" Condition="'$(DesignTime)'=='true' OR ('$(SolutionPath)'!='' AND Exists('$(SolutionPath)') AND '$(BuildingInsideVisualStudio)'!='true' AND '$(BuildingInsideExpressionBlend)'!='true')">
36-
<Generator>MSBuild:Compile</Generator>
37-
<SubType>Designer</SubType>
38-
<ContainsDesignTimeResources>true</ContainsDesignTimeResources>
39-
</Page>
33+
<Folder Include="Resources\" />
4034
</ItemGroup>
4135
<ItemGroup>
4236
<Resource Include="icon.ico" />
4337
</ItemGroup>
44-
</Project>
38+
</Project>

HandyDoc/MainWindow.xaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<hc:GlowWindow x:Class="HandyDoc.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:hc="https://handyorg.github.io/handycontrol"
7+
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:controls="http://schemas.modernwpf.com/toolkit/controls"
8+
mc:Ignorable="d" Loaded="Window_Loaded"
9+
Title="HandyDoc v2.0" ActiveGlowColor="{DynamicResource PrimaryColor}"
10+
WindowStartupLocation="CenterScreen"
11+
ShowTitle="True"
12+
Height="450"
13+
Width="800">
14+
<hc:GlowWindow.NonClientAreaContent>
15+
<Grid>
16+
<Grid.ColumnDefinitions>
17+
<ColumnDefinition/>
18+
<ColumnDefinition/>
19+
</Grid.ColumnDefinitions>
20+
<Button HorizontalAlignment="Right" Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryTextBrush}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
21+
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-35" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
22+
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
23+
<StackPanel Margin="10" Button.Click="ButtonSkins_OnClick" HorizontalAlignment="Center">
24+
<Button Tag="{x:Static hc:ApplicationTheme.Light}" Style="{StaticResource ButtonCustom}">
25+
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
26+
</Button>
27+
<Button Margin="0,10" Tag="{x:Static hc:ApplicationTheme.Dark}" Style="{StaticResource ButtonCustom}">
28+
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
29+
</Button>
30+
</StackPanel>
31+
</Border>
32+
</Popup>
33+
</Grid>
34+
</hc:GlowWindow.NonClientAreaContent>
35+
<hc:TransitioningContentControl TransitionMode="Fade">
36+
<ui:NavigationViewNonVirtualizing Name="navView" SelectionChanged="navView_SelectionChanged" IsBackButtonVisible="Collapsed" IsSettingsVisible="False" PaneDisplayMode="Left" >
37+
<ui:NavigationViewNonVirtualizing.AutoSuggestBox>
38+
<ui:AutoSuggestBox x:Name="autoBox" QueryIcon="Find" QuerySubmitted="controlsSearchBox_QuerySubmitted" TextChanged="controlsSearchBox_TextChanged" PlaceholderText="Search..."/>
39+
</ui:NavigationViewNonVirtualizing.AutoSuggestBox>
40+
<Grid>
41+
<Grid.RowDefinitions>
42+
<RowDefinition Height="auto"/>
43+
<RowDefinition/>
44+
</Grid.RowDefinitions>
45+
<ComboBox Name="cmbLang" ui:ControlHelper.PlaceholderText="Default Language is English" SelectionChanged="ComboBox_SelectionChanged" Margin="10" MinWidth="200" Style="{StaticResource DefaultComboBoxStyle}">
46+
<ComboBoxItem Content="English"/>
47+
<ComboBoxItem Content="Chinese"/>
48+
</ComboBox>
49+
<controls:MarkdownTextBlock Grid.Row="1" Name="mdText"/>
50+
</Grid>
51+
</ui:NavigationViewNonVirtualizing>
52+
</hc:TransitioningContentControl>
53+
</hc:GlowWindow>

0 commit comments

Comments
 (0)