├── Net45
└── Panuon.UI.Silver
│ ├── Models
│ └── NotifyPropertyChanged.cs
│ ├── Panuon.UI.Silver.csproj
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Resources
│ └── fontawesome.ttf
│ └── Themes
│ └── Generic.xaml
├── Panuon.UI.Silver
├── Panuon.UI.Silver.csproj
└── Properties
│ └── AssemblyInfo.cs
├── README.md
├── SharedResources
├── Panuon.UI.Silver.Core
│ ├── Attributes
│ │ ├── ColumnBindingAttribute.cs
│ │ ├── ColumnWidthAttribute.cs
│ │ ├── IgnoreColumnAttribute.cs
│ │ └── ReadOnlyColumnAttribute.cs
│ ├── EventHandler
│ │ ├── CancelableEventHandler.cs
│ │ ├── ClickEventHandler.cs
│ │ ├── CurrentIndexChangedEventHandler.cs
│ │ ├── DoubleClickEventHandler.cs
│ │ ├── DragAreaEventHandler.cs
│ │ ├── DragingEventHandler.cs
│ │ ├── IndexChangedEventHandler.cs
│ │ ├── LongPressEventHandler.cs
│ │ ├── SearchTextChangedEventHandler.cs
│ │ ├── SelectedBrushChangedEventHandler.cs
│ │ ├── SelectedDateChangedEventHandler.cs
│ │ ├── SelectedDateTimeChangedEventHandler.cs
│ │ └── TabItemRemovedEventHandler.cs
│ ├── Models
│ │ ├── BrushAnimation.cs
│ │ ├── IPendingingHandler.cs
│ │ ├── MessageBoxXConfigurations.cs
│ │ └── PendingBoxConfigurations.cs
│ ├── Panuon.UI.Silver.Core.projitems
│ └── Panuon.UI.Silver.Core.shproj
└── Panuon.UI.Silver
│ └── Control.xaml
├── UIBrowser
├── App.xaml
├── App.xaml.cs
├── Examples
│ ├── MacLikeWindow.xaml
│ ├── MacLikeWindow.xaml.cs
│ ├── NavbarWindow.xaml
│ ├── NavbarWindow.xaml.cs
│ ├── NeteaseMusicWindow.xaml
│ └── NeteaseMusicWindow.xaml.cs
├── Helpers
│ └── Helper.cs
├── HomeWindow.xaml
├── HomeWindow.xaml.cs
├── HookPage.xaml
├── HookPage.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Models
│ └── TreeViewItemModel.cs
├── OCRPage.xaml
├── OCRPage.xaml.cs
├── PartialViews
│ ├── Custom
│ │ ├── BadgeView.xaml
│ │ ├── BadgeView.xaml.cs
│ │ ├── CalendarView.xaml
│ │ ├── CalendarView.xaml.cs
│ │ ├── CarouselView.xaml
│ │ ├── CarouselView.xaml.cs
│ │ ├── ColorPickerView.xaml
│ │ ├── ColorPickerView.xaml.cs
│ │ ├── ColorSelectorView.xaml
│ │ ├── ColorSelectorView.xaml.cs
│ │ ├── DateTimePickerView.xaml
│ │ ├── DateTimePickerView.xaml.cs
│ │ ├── DropDownView.xaml
│ │ ├── DropDownView.xaml.cs
│ │ ├── LoadingView.xaml
│ │ ├── LoadingView.xaml.cs
│ │ ├── MessageBoxXView.xaml
│ │ ├── MessageBoxXView.xaml.cs
│ │ ├── MultiComboBoxView.xaml
│ │ ├── MultiComboBoxView.xaml.cs
│ │ ├── NoticeView.xaml
│ │ ├── NoticeView.xaml.cs
│ │ ├── PaginationView.xaml
│ │ ├── PaginationView.xaml.cs
│ │ ├── PendingBoxView.xaml
│ │ ├── PendingBoxView.xaml.cs
│ │ ├── WaterfallViewerView.xaml
│ │ ├── WaterfallViewerView.xaml.cs
│ │ ├── WindowXView.xaml
│ │ └── WindowXView.xaml.cs
│ ├── Helpers
│ │ ├── AnimationHelperView.xaml
│ │ └── AnimationHelperView.xaml.cs
│ ├── Native
│ │ ├── ButtonView.xaml
│ │ ├── ButtonView.xaml.cs
│ │ ├── CheckBoxView.xaml
│ │ ├── CheckBoxView.xaml.cs
│ │ ├── ComboBoxView.xaml
│ │ ├── ComboBoxView.xaml.cs
│ │ ├── ContextMenuView.xaml
│ │ ├── ContextMenuView.xaml.cs
│ │ ├── DataGridView.xaml
│ │ ├── DataGridView.xaml.cs
│ │ ├── ExpanderView.xaml
│ │ ├── ExpanderView.xaml.cs
│ │ ├── GroupBoxView.xaml
│ │ ├── GroupBoxView.xaml.cs
│ │ ├── MenuView.xaml
│ │ ├── MenuView.xaml.cs
│ │ ├── PasswordBoxView.xaml
│ │ ├── PasswordBoxView.xaml.cs
│ │ ├── ProgressBarView.xaml
│ │ ├── ProgressBarView.xaml.cs
│ │ ├── RadioButtonView.xaml
│ │ ├── RadioButtonView.xaml.cs
│ │ ├── SliderView.xaml
│ │ ├── SliderView.xaml.cs
│ │ ├── TabControlView.xaml
│ │ ├── TabControlView.xaml.cs
│ │ ├── TextBoxView.xaml
│ │ ├── TextBoxView.xaml.cs
│ │ ├── TreeViewView.xaml
│ │ └── TreeViewView.xaml.cs
│ ├── OverviewView.xaml
│ └── OverviewView.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── Resource.resx
├── Resources
│ ├── NeteaseExample
│ │ └── iconfont.ttf
│ ├── Styles.xaml
│ └── head.jpg
├── TTSPage.xaml
├── TTSPage.xaml.cs
├── TranslationPage.xaml
├── TranslationPage.xaml.cs
├── UIBrowser.csproj
├── UIBrowser.csproj.user
├── VNREX.ico
├── VNREX
│ ├── Common
│ │ ├── AbstractClient.cs
│ │ ├── AbstractModel.cs
│ │ ├── Credential.cs
│ │ ├── Exception
│ │ │ └── TencentCloudSDKException.cs
│ │ ├── Http
│ │ │ └── HttpConnection.cs
│ │ ├── JsonResponseErrModel.cs
│ │ ├── JsonResponseModel.cs
│ │ ├── Profile
│ │ │ ├── ClientProfile.cs
│ │ │ └── HttpProfile.cs
│ │ ├── Sign.cs
│ │ └── TencentCloudCommon.csproj
│ ├── Global.cs
│ ├── GlobalHotKey
│ │ ├── GlobalHotkey.cs
│ │ └── VNREXHotKey.cs
│ ├── Hook
│ │ ├── TextHook.cs
│ │ └── TranslateWindow.cs
│ ├── NamePipe
│ │ └── NamePipeServer.cs
│ ├── OCR
│ │ └── OCRServer.cs
│ ├── TTS
│ │ └── VoiceRoid2.cs
│ ├── Tmt
│ │ ├── Models
│ │ │ ├── ImageRecord.cs
│ │ │ ├── ImageTranslateRequest.cs
│ │ │ ├── ImageTranslateResponse.cs
│ │ │ ├── ItemValue.cs
│ │ │ ├── LanguageDetectRequest.cs
│ │ │ ├── LanguageDetectResponse.cs
│ │ │ ├── SpeechTranslateRequest.cs
│ │ │ ├── SpeechTranslateResponse.cs
│ │ │ ├── TextTranslateBatchRequest.cs
│ │ │ ├── TextTranslateBatchResponse.cs
│ │ │ ├── TextTranslateRequest.cs
│ │ │ └── TextTranslateResponse.cs
│ │ ├── TencentCloudTmt.csproj
│ │ └── V20180321
│ │ │ ├── Models
│ │ │ ├── ImageRecord.cs
│ │ │ ├── ImageTranslateRequest.cs
│ │ │ ├── ImageTranslateResponse.cs
│ │ │ ├── ItemValue.cs
│ │ │ ├── LanguageDetectRequest.cs
│ │ │ ├── LanguageDetectResponse.cs
│ │ │ ├── SpeechTranslateRequest.cs
│ │ │ ├── SpeechTranslateResponse.cs
│ │ │ ├── TextTranslateBatchRequest.cs
│ │ │ ├── TextTranslateBatchResponse.cs
│ │ │ ├── TextTranslateRequest.cs
│ │ │ └── TextTranslateResponse.cs
│ │ │ └── TmtClient.cs
│ ├── TranslateController.cs
│ └── Translation
│ │ ├── BaiduTanslate.cs
│ │ ├── CaiYunTranslate.cs
│ │ ├── TencentTanslate.cs
│ │ └── YouDaoTranslateFreeOld.cs
├── VNRHomeWindow.xaml
├── VNRHomeWindow.xaml.cs
├── ViewModels
│ └── MainWindowViewModel.cs
├── app.config
└── packages.config
├── VNREX.ico
├── VNREX.sln
└── Visual Studio 2019
└── Visualizers
└── attribcache140.bin
/Net45/Panuon.UI.Silver/Models/NotifyPropertyChanged.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 | using System.ComponentModel;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class PropertyChangedBase : INotifyPropertyChanged
7 | {
8 | public event PropertyChangedEventHandler PropertyChanged;
9 |
10 | protected void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
11 | {
12 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Panuon.UI.Silver.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {461FE59D-57B8-4599-8E7D-439E27A2BBB2}
8 | library
9 | Panuon.UI.Silver
10 | Panuon.UI.Silver
11 | v4.5
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 |
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 | false
27 |
28 |
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | false
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | 4.0
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | Code
58 |
59 |
60 | True
61 | True
62 | Resources.resx
63 |
64 |
65 | True
66 | Settings.settings
67 | True
68 |
69 |
70 | ResXFileCodeGenerator
71 | Resources.Designer.cs
72 |
73 |
74 | SettingsSingleFileGenerator
75 | Settings.Designer.cs
76 |
77 |
78 |
79 |
80 |
81 | MSBuild:Compile
82 | Designer
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // 有关程序集的一般信息由以下
8 | // 控制。更改这些特性值可修改
9 | // 与程序集关联的信息。
10 | [assembly: AssemblyTitle("Panuon.UI.Silver")]
11 | [assembly: AssemblyDescription("A beautiful wpf ui control library.")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Panuon")]
14 | [assembly: AssemblyProduct("PanuonUI.Silver")]
15 | [assembly: AssemblyCopyright("Copyright © Panuon. 2019")]
16 | [assembly: AssemblyTrademark("Panuon")]
17 | [assembly: AssemblyCulture("")]
18 | [assembly: InternalsVisibleTo("PanuonUI.Silver.Extends")]
19 |
20 | //将 ComVisible 设置为 false 将使此程序集中的类型
21 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
22 | //请将此类型的 ComVisible 特性设置为 true。
23 | [assembly: ComVisible(false)]
24 |
25 | //若要开始生成可本地化的应用程序,请设置
26 | //.csproj 文件中的 CultureYouAreCodingWith
27 | //例如,如果您在源文件中使用的是美国英语,
28 | //使用的是美国英语,请将 设置为 en-US。 然后取消
29 | //对以下 NeutralResourceLanguage 特性的注释。 更新
30 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
31 |
32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
33 |
34 |
35 | [assembly:ThemeInfo(
36 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置
37 | //(未在页面中找到资源时使用,
38 | //或应用程序资源字典中找到时使用)
39 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
40 | //(未在页面中找到资源时使用,
41 | //、应用程序或任何主题专用资源字典中找到时使用)
42 | )]
43 |
44 |
45 | // 程序集的版本信息由下列四个值组成:
46 | //
47 | // 主版本
48 | // 次版本
49 | // 生成号
50 | // 修订号
51 | //
52 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
53 | // 方法是按如下所示使用“*”: :
54 | // [assembly: AssemblyVersion("1.0.*")]
55 | [assembly: AssemblyVersion("1.1.3.0")]
56 | [assembly: AssemblyFileVersion("1.1.3.0")]
57 | [assembly: Guid("16dbb0c9-f9b0-4bcf-a1f6-cb740041699e")]
58 |
59 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Panuon.UI.Silver.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Panuon.UI.Silver.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Panuon.UI.Silver.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Net45/Panuon.UI.Silver/Resources/fontawesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Lilyltt/VNREXwithGPT/c5bbae1fa3f96babcda5c2ab8f566da9adcf868c/Net45/Panuon.UI.Silver/Resources/fontawesome.ttf
--------------------------------------------------------------------------------
/Panuon.UI.Silver/Panuon.UI.Silver.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | c83cf5d8-c83d-4666-be50-49a554e0650e
8 | Library
9 | Properties
10 | Panuon.UI.Silver
11 | Panuon.UI.Silver
12 | v4.7.2
13 | 512
14 | true
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/Panuon.UI.Silver/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Panuon.UI.Silver")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("HP Inc.")]
12 | [assembly: AssemblyProduct("Panuon.UI.Silver")]
13 | [assembly: AssemblyCopyright("Copyright © HP Inc. 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("c83cf5d8-c83d-4666-be50-49a554e0650e")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 施工中
2 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Attributes/ColumnBindingAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Data;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 |
7 | [AttributeUsage(AttributeTargets.Property)]
8 | public class ColumnBindingAttribute : Attribute
9 | {
10 | ///
11 | /// Custom binding mode.
12 | ///
13 | public ColumnBindingAttribute()
14 | {
15 | BindingMode = BindingMode.TwoWay;
16 | UpdateSourceTrigger = UpdateSourceTrigger.LostFocus;
17 | }
18 |
19 | ///
20 | /// Custom binding mode.
21 | ///
22 | public ColumnBindingAttribute(BindingMode bindingMode)
23 | {
24 | BindingMode = bindingMode;
25 | UpdateSourceTrigger = UpdateSourceTrigger.LostFocus;
26 | }
27 |
28 | ///
29 | /// Custom binding mode.
30 | ///
31 | public ColumnBindingAttribute(BindingMode bindingMode, UpdateSourceTrigger updateSourceTrigger)
32 | {
33 | BindingMode = bindingMode;
34 | UpdateSourceTrigger = updateSourceTrigger;
35 | }
36 |
37 | public BindingMode BindingMode { get; set; }
38 |
39 | public UpdateSourceTrigger UpdateSourceTrigger { get; set; }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Attributes/ColumnWidthAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 |
6 | [AttributeUsage(AttributeTargets.Property)]
7 | public class ColumnWidthAttribute : Attribute
8 | {
9 | ///
10 | /// Auto column width.
11 | ///
12 | public ColumnWidthAttribute()
13 | {
14 | Width = "auto";
15 | }
16 |
17 | ///
18 | /// Custom column width. Pixel, star or auto.
19 | ///
20 | ///
21 | public ColumnWidthAttribute(string width)
22 | {
23 | Width = width;
24 | }
25 |
26 | public string Width { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Attributes/IgnoreColumnAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | [AttributeUsage(AttributeTargets.Property)]
6 | public class IgnoreColumnAttribute : Attribute
7 | {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Attributes/ReadOnlyColumnAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | [AttributeUsage(AttributeTargets.Property)]
6 | public class ReadOnlyColumnAttribute : Attribute
7 | {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/CancelableEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Panuon.UI.Silver.Core
6 | {
7 | public class CancelableEventArgs : EventArgs
8 | {
9 | public CancelableEventArgs() : base()
10 | {
11 | }
12 |
13 | public bool Cancel { get; set; }
14 | }
15 |
16 | public delegate void CancelableEventHandler(object sender, CancelableEventArgs e);
17 | }
18 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/ClickEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public class ClickEventArgs : RoutedEventArgs
6 | {
7 | public ClickEventArgs(Point position, RoutedEvent routedEvent) : base(routedEvent)
8 | {
9 | Position = position;
10 | }
11 |
12 | public Point Position { get; set; }
13 | }
14 |
15 | public delegate void ClickEventHandler(object sender, ClickEventArgs e);
16 | }
17 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/CurrentIndexChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public class CurrentIndexChangedEventArgs : RoutedEventArgs
6 | {
7 | public CurrentIndexChangedEventArgs(int currentIndex, RoutedEvent routedEvent) : base(routedEvent)
8 | {
9 | CurrentIndex = currentIndex;
10 | }
11 |
12 | public int CurrentIndex { get; set; }
13 | }
14 |
15 | public delegate void CurrentIndexChangedEventHandler(object sender, CurrentIndexChangedEventArgs e);
16 | }
17 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/DoubleClickEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public class DoubleClickEventArgs : RoutedEventArgs
6 | {
7 | public DoubleClickEventArgs(Point position, RoutedEvent routedEvent) : base(routedEvent)
8 | {
9 | Position = position;
10 | }
11 |
12 | public Point Position { get; set; }
13 | }
14 |
15 | public delegate void DoubleClickEventHandler(object sender, DoubleClickEventArgs e);
16 | }
17 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/DragAreaEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class DragAreaEventArgs : RoutedEventArgs
7 | {
8 | public DragAreaEventArgs(Point startPosition, Point endPosition, TimeSpan duration, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | StartPosition = startPosition;
11 | EndPosition = endPosition;
12 | Duration = duration;
13 | }
14 |
15 | public Point StartPosition { get; set; }
16 |
17 | public Point EndPosition { get; set; }
18 |
19 | public TimeSpan Duration { get; set; }
20 |
21 | public Size Size => new Size()
22 | {
23 | Height = Math.Abs(StartPosition.Y - EndPosition.Y),
24 | Width = Math.Abs(StartPosition.X - EndPosition.X),
25 | };
26 | }
27 |
28 | public delegate void DragAreaEventHandler(object sender, DragAreaEventArgs e);
29 | }
30 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/DragingEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class DragingEventArgs : RoutedEventArgs
7 | {
8 | public DragingEventArgs(Point startPosition, Point endPosition, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | StartPosition = startPosition;
11 | EndPosition = endPosition;
12 | }
13 | public Point StartPosition { get; set; }
14 |
15 | public Point EndPosition { get; set; }
16 |
17 | public Size Size => new Size()
18 | {
19 | Height = Math.Abs(StartPosition.Y - EndPosition.Y),
20 | Width = Math.Abs(StartPosition.X - EndPosition.X),
21 | };
22 | }
23 |
24 | public delegate void DragingEventHandler(object sender, DragingEventArgs e);
25 | }
26 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/IndexChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public class IndexChangedEventArgs : RoutedEventArgs
6 | {
7 | public IndexChangedEventArgs(int currentIndex, RoutedEvent routedEvent) : base(routedEvent)
8 | {
9 | CurrentIndex = currentIndex;
10 | }
11 |
12 | public int CurrentIndex { get; set; }
13 | }
14 |
15 | public delegate void IndexChangedEventHandler(object sender, IndexChangedEventArgs e);
16 | }
17 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/LongPressEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class LongPressEventArgs : RoutedEventArgs
7 | {
8 | public LongPressEventArgs(Point position, TimeSpan duration, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | Position = position;
11 | Duration = duration;
12 | }
13 |
14 | public Point Position { get; set; }
15 |
16 | public TimeSpan Duration { get; set; }
17 | }
18 |
19 | public delegate void LongPressEventHandler(object sender, LongPressEventArgs e);
20 | }
21 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/SearchTextChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public class SearchTextChangedEventArgs : RoutedEventArgs
6 | {
7 | public SearchTextChangedEventArgs(string text, RoutedEvent routedEvent) : base(routedEvent)
8 | {
9 | Text = text;
10 | }
11 |
12 | public string Text { get; set; }
13 | }
14 |
15 | public delegate void SearchTextChangedEventHandler(object sender, SearchTextChangedEventArgs e);
16 | }
17 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/SelectedBrushChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class SelectedBrushChangedEventArgs : RoutedEventArgs
7 | {
8 | public SelectedBrushChangedEventArgs(Brush selectedBrush, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | SelectedBrush = selectedBrush;
11 | }
12 |
13 | public Brush SelectedBrush { get; set; }
14 | }
15 |
16 | public delegate void SelectedBrushChangedEventHandler(object sender, SelectedBrushChangedEventArgs e);
17 | }
18 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/SelectedDateChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class SelectedDateChangedEventArgs : RoutedEventArgs
7 | {
8 | public SelectedDateChangedEventArgs(DateTime dateTime, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | Date = dateTime.Date;
11 | }
12 |
13 | public DateTime Date { get; set; }
14 | }
15 |
16 | public delegate void SelectedDateChangedEventHandler(object sender, SelectedDateChangedEventArgs e);
17 | }
18 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/SelectedDateTimeChangedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class SelectedDateTimeChangedEventArgs : RoutedEventArgs
7 | {
8 | public SelectedDateTimeChangedEventArgs(DateTime dateTime, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | DateTime = dateTime;
11 | }
12 |
13 | public DateTime DateTime { get; set; }
14 | }
15 |
16 | public delegate void SelectedDateTimeChangedEventHandler(object sender, SelectedDateTimeChangedEventArgs e);
17 | }
18 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/EventHandler/TabItemRemovedEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace Panuon.UI.Silver.Core
5 | {
6 | public class TabItemRemovedEventArgs : RoutedEventArgs
7 | {
8 | public TabItemRemovedEventArgs(TabItem removedItem, bool removedFromSource, RoutedEvent routedEvent) : base(routedEvent)
9 | {
10 | RemovedItem = removedItem;
11 | RemovedFromSource = removedFromSource;
12 | }
13 |
14 | public TabItem RemovedItem { get; set; }
15 |
16 | public bool RemovedFromSource { get; set; }
17 | }
18 |
19 | public delegate void TabItemRemovedEventHandler(object sender, TabItemRemovedEventArgs e);
20 | }
21 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Models/BrushAnimation.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver.Utils;
2 | using System;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Media;
6 | using System.Windows.Media.Animation;
7 |
8 | namespace Panuon.UI.Silver.Core
9 | {
10 | public class BrushAnimation : AnimationTimeline
11 | {
12 | #region Properties
13 | public Brush From
14 | {
15 | get { return (Brush)GetValue(FromProperty); }
16 | set { SetValue(FromProperty, value); }
17 | }
18 |
19 | public static readonly DependencyProperty FromProperty =
20 | DependencyProperty.Register("From", typeof(Brush), typeof(BrushAnimation));
21 |
22 | public Brush To
23 | {
24 | get { return (Brush)GetValue(ToProperty); }
25 | set { SetValue(ToProperty, value); }
26 | }
27 |
28 | public static readonly DependencyProperty ToProperty =
29 | DependencyProperty.Register("To", typeof(Brush), typeof(BrushAnimation));
30 |
31 | #endregion
32 |
33 | #region Override
34 | public override Type TargetPropertyType => typeof(Brush);
35 |
36 | public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
37 | {
38 | return GetCurrentValue(defaultOriginValue as Brush, defaultDestinationValue as Brush, animationClock);
39 | }
40 |
41 | protected override Freezable CreateInstanceCore()
42 | {
43 | return new BrushAnimation();
44 | }
45 |
46 | public object GetCurrentValue(Brush defaultOriginValue, Brush defaultDestinationValue, AnimationClock animationClock)
47 | {
48 | if (!animationClock.CurrentProgress.HasValue)
49 | return Brushes.Transparent;
50 |
51 | defaultOriginValue = this.From ?? defaultOriginValue;
52 | defaultDestinationValue = this.To ?? defaultDestinationValue;
53 |
54 | if (animationClock.CurrentProgress.Value == 0)
55 | return defaultOriginValue;
56 | if (animationClock.CurrentProgress.Value == 1)
57 | return defaultDestinationValue;
58 |
59 | if (To != null)
60 | {
61 | if (defaultDestinationValue is SolidColorBrush && ((SolidColorBrush)defaultDestinationValue).Color.A < 255
62 | && (!(defaultOriginValue is SolidColorBrush) || (((SolidColorBrush)defaultOriginValue).Color.A == 255)))
63 | {
64 | return BrushUtils.GetVisualBrush(defaultDestinationValue, defaultOriginValue, 1 - animationClock.CurrentProgress.Value);
65 | }
66 | else
67 | {
68 | return BrushUtils.GetVisualBrush(defaultOriginValue, defaultDestinationValue, animationClock.CurrentProgress.Value);
69 | }
70 | }
71 | else
72 | {
73 | if (defaultOriginValue is SolidColorBrush && ((SolidColorBrush)defaultOriginValue).Color.A < 255
74 | && (!(defaultDestinationValue is SolidColorBrush) || (((SolidColorBrush)defaultDestinationValue).Color.A == 255)))
75 | {
76 | return BrushUtils.GetVisualBrush(defaultOriginValue, defaultDestinationValue, animationClock.CurrentProgress.Value);
77 | }
78 | else
79 | {
80 | return BrushUtils.GetVisualBrush(defaultDestinationValue, defaultOriginValue, 1 - animationClock.CurrentProgress.Value);
81 | }
82 | }
83 | }
84 | #endregion
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Models/IPendingingHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Panuon.UI.Silver.Core
4 | {
5 | public interface IPendingHandler
6 | {
7 | ///
8 | /// Pending box closed.
9 | ///
10 | event EventHandler Closed;
11 |
12 | ///
13 | /// User canceled.
14 | ///
15 | event EventHandler Cancel;
16 |
17 | ///
18 | /// Close pending box.
19 | ///
20 | void Close();
21 |
22 | ///
23 | /// Update message of pending box.
24 | ///
25 | void UpdateMessage(string message);
26 | }
27 |
28 | internal class PendingHandler : IPendingHandler
29 | {
30 | #region Identifier
31 | private Action _closeAction;
32 | private Action _updateMessageAction;
33 | #endregion
34 |
35 | #region Constructor
36 | public PendingHandler(Action closeAction, Action updateMessageAction)
37 | {
38 | _closeAction = closeAction;
39 | _updateMessageAction = updateMessageAction;
40 | }
41 | #endregion
42 |
43 | #region Event
44 | public event EventHandler Closed;
45 | public event EventHandler Cancel;
46 |
47 | public void Close()
48 | {
49 | _closeAction();
50 | }
51 | #endregion
52 |
53 | #region Calling Methods
54 | public void RaiseClosedEvent(object sender, EventArgs e)
55 | {
56 | Closed?.Invoke(sender, e);
57 | }
58 |
59 | public void RaiseCanceledEvent(object sender, EventArgs e)
60 | {
61 | Cancel?.Invoke(sender, e);
62 | }
63 |
64 | public void UpdateMessage(string message)
65 | {
66 | _updateMessageAction(message);
67 | }
68 | #endregion
69 |
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Models/MessageBoxXConfigurations.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver.Utils;
2 | using System.Windows;
3 | using System.Windows.Media;
4 |
5 | namespace Panuon.UI.Silver.Core
6 | {
7 | public class MessageBoxXConfigurations
8 | {
9 | public MessageBoxXConfigurations()
10 | {
11 | switch (System.Threading.Thread.CurrentThread.CurrentUICulture.IetfLanguageTag)
12 | {
13 | case "zh-CN":
14 | YesButton = "是 的";
15 | NoButton = "不";
16 | OKButton = "好 的";
17 | CancelButton = "取 消";
18 | break;
19 | }
20 | }
21 |
22 | ///
23 | /// MessageBox style.
24 | ///
25 | public MessageBoxStyle MessageBoxStyle { get; set; } = MessageBoxStyle.Standard;
26 |
27 | ///
28 | /// MessageBox icon
29 | ///
30 | public MessageBoxIcon MessageBoxIcon { get; set; } = MessageBoxIcon.Info;
31 |
32 | ///
33 | /// Default button
34 | ///
35 | public DefaultButton DefaultButton { get; set; } = DefaultButton.YesOK;
36 |
37 | ///
38 | /// Button Brush
39 | ///
40 | public Brush ButtonBrush { get; set; } = "#55CEF1".ToColor().ToBrush();
41 |
42 | ///
43 | /// Min height. Default : 250.
44 | ///
45 | public double MinHeight { get; set; } = 250;
46 |
47 | ///
48 | /// Min width. Default : 500.
49 | ///
50 | public double MinWidth { get; set; } = 500;
51 |
52 | ///
53 | /// Font size. Default : 16.
54 | ///
55 | public double FontSize { get; set; } = 16;
56 |
57 | ///
58 | /// Max content height. default : 100.
59 | ///
60 | public double MaxContentHeight { get; set; } = 100;
61 |
62 | ///
63 | /// Max content width. Default : 300;
64 | ///
65 | public double MaxContentWidth { get; set; } = 300;
66 |
67 | ///
68 | /// Show in taskbar.
69 | ///
70 | public bool ShowInTaskbar { get; set; } = true;
71 |
72 | ///
73 | /// Topmost.
74 | ///
75 | public bool Topmost { get; set; } = true;
76 |
77 | ///
78 | /// Window startup location.
79 | ///
80 | public WindowStartupLocation WindowStartupLocation { get; set; } = WindowStartupLocation.CenterScreen;
81 |
82 | ///
83 | /// Show owner's mask when popuped, and hide it when closed. Only worked with WindowX type owner.
84 | ///
85 | public bool InteractOwnerMask { get; set; } = true;
86 |
87 | ///
88 | /// Content of yes button.
89 | ///
90 | public string YesButton { get; set; } = "Yes";
91 |
92 | ///
93 | /// Content of no button.
94 | ///
95 | public string NoButton { get; set; } = "No";
96 |
97 | ///
98 | /// Content of ok button.
99 | ///
100 | public string OKButton { get; set; } = "OK";
101 |
102 | ///
103 | /// Content of cancel button.
104 | ///
105 | public string CancelButton { get; set; } = "Cancel";
106 |
107 | ///
108 | /// Reverse button sequence.
109 | ///
110 | public bool ReverseButtonSequence { get; set; }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Models/PendingBoxConfigurations.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver.Utils;
2 | using System.Windows;
3 | using System.Windows.Media;
4 |
5 | namespace Panuon.UI.Silver.Core
6 | {
7 | public class PendingBoxConfigurations
8 | {
9 | public PendingBoxConfigurations()
10 | {
11 | switch (System.Threading.Thread.CurrentThread.CurrentUICulture.IetfLanguageTag)
12 | {
13 | case "zh-CN":
14 | CancelButton = "取 消";
15 | break;
16 | }
17 | }
18 |
19 | ///
20 | /// Pending box style. Default : Standard.
21 | ///
22 | public PendingBoxStyle PendingBoxStyle { get; set; } = PendingBoxStyle.Standard;
23 |
24 | ///
25 | /// Loding style. Default : Ring2.
26 | ///
27 | public LoadingStyle LoadingStyle { get; set; } = LoadingStyle.Ring2;
28 |
29 | ///
30 | /// Theme Brush. Default : #3E3E3E.
31 | ///
32 | public Brush ButtonBrush { get; set; } = "#3E3E3E".ToColor().ToBrush();
33 |
34 | ///
35 | /// Loading stroke. Default : Transparent.
36 | ///
37 | public Brush LoadingBackground { get; set; } = Brushes.Transparent;
38 |
39 | ///
40 | /// Loading stroke cover. Default : #3E3E3E
41 | ///
42 | public Brush LoadingForeground { get; set; } = "#3E3E3E".ToColor().ToBrush();
43 |
44 | ///
45 | /// Foreground.
46 | ///
47 | public Brush Foreground { get; set; } = "#3E3E3E".ToColor().ToBrush();
48 |
49 | ///
50 | /// Min height. Default : 250.
51 | ///
52 | public double MinHeight { get; set; } = 200;
53 |
54 | ///
55 | /// Min width. Default : 500.
56 | ///
57 | public double MinWidth { get; set; } = 450;
58 |
59 | ///
60 | /// Min height. Default : 250.
61 | ///
62 | public double MaxHeight { get; set; } = 200;
63 |
64 | ///
65 | /// Min width. Default : 500.
66 | ///
67 | public double MaxWidth { get; set; } = 450;
68 |
69 | ///
70 | /// Font size. Default : 16.
71 | ///
72 | public double FontSize { get; set; } = 16;
73 |
74 | ///
75 | /// Loading size
76 | ///
77 | public double LoadingSize { get; set; } = 35;
78 |
79 | ///
80 | /// Show in taskbar.
81 | ///
82 | public bool ShowInTaskbar { get; set; } = true;
83 |
84 | ///
85 | /// Topmost.
86 | ///
87 | public bool Topmost { get; set; } = true;
88 |
89 | ///
90 | /// Window startup location.
91 | ///
92 | public WindowStartupLocation WindowStartupLocation { get; set; } = WindowStartupLocation.CenterScreen;
93 |
94 | ///
95 | /// Show owner's mask when popuped, and hide it when closed. Only worked with WindowX type owner.
96 | ///
97 | public bool InteractOwnerMask { get; set; } = true;
98 |
99 | ///
100 | /// Content of cancel button.
101 | ///
102 | public string CancelButton { get; set; } = "Cancel";
103 |
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Panuon.UI.Silver.Core.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | dc698b56-ea97-4d48-9e82-e261324ec475
7 |
8 |
9 | Panuon.UI.Silver.Core
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver.Core/Panuon.UI.Silver.Core.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | dc698b56-ea97-4d48-9e82-e261324ec475
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/SharedResources/Panuon.UI.Silver/Control.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/UIBrowser/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/UIBrowser/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Globalization;
6 | using System.Linq;
7 | using System.Threading;
8 | using System.Windows;
9 |
10 | namespace UIBrowser
11 | {
12 | ///
13 | /// App.xaml 的交互逻辑
14 | ///
15 | public partial class App : Application
16 | {
17 | public App()
18 | {
19 | Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
20 | //System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/UIBrowser/Examples/MacLikeWindow.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
18 |
20 |
22 |
23 |
24 |
25 |
26 |
29 |
38 |
47 |
56 |
57 |
61 |
62 |
63 |
64 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/UIBrowser/Examples/MacLikeWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver;
2 | using System.Windows;
3 |
4 | namespace UIBrowser.Examples
5 | {
6 | ///
7 | /// MacLikeWindow.xaml 的交互逻辑
8 | ///
9 | public partial class MacLikeWindow : WindowX
10 | {
11 | public MacLikeWindow()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void BtnClose_Click(object sender, RoutedEventArgs e)
17 | {
18 | Close();
19 | }
20 |
21 | private void BtnMin_Click(object sender, RoutedEventArgs e)
22 | {
23 | WindowState = WindowState.Minimized;
24 | }
25 |
26 | private void BtnMax_Click(object sender, RoutedEventArgs e)
27 | {
28 | if (WindowState == WindowState.Maximized)
29 | WindowState = WindowState.Normal;
30 | else
31 | WindowState = WindowState.Maximized;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/UIBrowser/Examples/NavbarWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver;
2 | using System.Windows;
3 |
4 | namespace UIBrowser.Examples
5 | {
6 | ///
7 | /// MacLikeWindow.xaml 的交互逻辑
8 | ///
9 | public partial class NavbarWindow : WindowX
10 | {
11 | public NavbarWindow()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void BtnClose_Click(object sender, RoutedEventArgs e)
17 | {
18 | Close();
19 | }
20 |
21 | private void BtnMin_Click(object sender, RoutedEventArgs e)
22 | {
23 | WindowState = WindowState.Minimized;
24 | }
25 |
26 | private void BtnMax_Click(object sender, RoutedEventArgs e)
27 | {
28 | if (WindowState == WindowState.Maximized)
29 | WindowState = WindowState.Normal;
30 | else
31 | WindowState = WindowState.Minimized;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/UIBrowser/Examples/NeteaseMusicWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver;
2 | using Panuon.UI.Silver.Core;
3 |
4 | namespace UIBrowser.Examples
5 | {
6 | ///
7 | /// NeteaseMusicWindow.xaml 的交互逻辑
8 | ///
9 | public partial class NeteaseMusicWindow : WindowX
10 | {
11 | public NeteaseMusicWindow()
12 | {
13 | InitializeComponent();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/UIBrowser/Helpers/Helper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows.Media;
4 |
5 | namespace UIBrowser.Helpers
6 | {
7 | public class Helper
8 | {
9 | ///
10 | /// Computer render performance. Good = 2, Normal = 1, Bad = 0.
11 | ///
12 | public static int Tier { get; set; }
13 |
14 | static Helper()
15 | {
16 | Tier = RenderCapability.Tier >> 16;
17 | }
18 |
19 | public static Color GetColorByOffset(GradientStopCollection collection, double offset)
20 | {
21 | var stops = collection.OrderBy(x => x.Offset).ToArray();
22 | if (offset <= 0) return stops[0].Color;
23 | if (offset >= 1) return stops[stops.Length - 1].Color;
24 | var left = stops.Where(s => s.Offset <= offset).Last();
25 | var right = stops.Where(s => s.Offset > offset).First();
26 | offset = Math.Round((offset - left.Offset) / (right.Offset - left.Offset), 2);
27 | var a = (byte)((right.Color.A - left.Color.A) * offset + left.Color.A);
28 | var r = (byte)((right.Color.R - left.Color.R) * offset + left.Color.R);
29 | var g = (byte)((right.Color.G - left.Color.G) * offset + left.Color.G);
30 | var b = (byte)((right.Color.B - left.Color.B) * offset + left.Color.B);
31 | return Color.FromArgb(a, r, g, b);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/UIBrowser/HomeWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/UIBrowser/HomeWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 | using System.Windows.Markup;
16 | namespace UIBrowser
17 | {
18 | ///
19 | /// HomeWindow.xaml 的交互逻辑
20 | ///
21 | public partial class HomeWindow : WindowX, IComponentConnector
22 | {
23 | public HomeWindow()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void ListBoxItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
29 | {
30 | ContenFrame.Navigate(new Uri("HookPage.xaml", UriKind.Relative));
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/UIBrowser/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
41 |
49 |
50 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
69 |
72 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/UIBrowser/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Panuon.UI.Silver;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Runtime.CompilerServices;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Markup;
10 | using UIBrowser.Models;
11 | using UIBrowser.ViewModels;
12 |
13 | namespace UIBrowser
14 | {
15 | ///
16 | /// MainWindow.xaml 的交互逻辑
17 | ///
18 | public partial class MainWindow : WindowX, IComponentConnector
19 | {
20 | #region Identity
21 | private static IDictionary _partialViewDic;
22 | #endregion
23 |
24 | #region Property
25 | public MainWindowViewModel ViewModel { get; set; }
26 |
27 | public string Text { get; set; }
28 | #endregion
29 |
30 | #region Constructor
31 | static MainWindow()
32 | {
33 | _partialViewDic = new Dictionary();
34 | var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.FullName.StartsWith("UIBrowser"));
35 | assembly.GetTypes().Where(x => x.Namespace.StartsWith("UIBrowser.PartialViews") && x.IsSubclassOf(typeof(UserControl))).ToList().ForEach(x => _partialViewDic.Add(x.Name.Remove(x.Name.Length - 4), x));
36 | }
37 |
38 | public MainWindow()
39 | {
40 | InitializeComponent();
41 | ViewModel = new MainWindowViewModel();
42 | DataContext = ViewModel;
43 | }
44 |
45 | #endregion
46 |
47 | #region EventHandler
48 | private void TvMenu_SelectionChanged(object sender, RoutedPropertyChangedEventArgs