├── Build
├── build.ps1
├── cake.config
├── tools
│ ├── nuget.exe
│ └── packages.config
├── nuget.config
├── build.cake
└── build.sh
├── icon_64x64.png
├── AcorisoftTeam.png
├── Sponsor_Wechat.jpg
├── Thumbnails
├── Buttons.gif
├── Buttons.png
├── Panels.gif
├── AlertPanel.png
├── CTA_Button.gif
├── ModeButton.gif
├── CalloutPanel.png
├── Link_Button.gif
├── Solid_Button.gif
├── ToolbarPanel.png
├── FadeIn_Button.gif
├── FadeOut_Button.gif
├── Opacity_Button.gif
├── Outline_Button.gif
└── Transparency_Button.gif
├── CustomControl_Lesson_1_1.png
├── CustomControl_Lesson_1_2.png
├── CustomControl_Lesson_1_3.png
├── CustomControl_Lesson_1_4.png
├── src
├── Acorisoft.UI
│ ├── icon_64x64.png
│ ├── Themes
│ │ ├── Banner.xaml
│ │ ├── Buttons
│ │ │ ├── VisibleButton.xaml
│ │ │ ├── LockButton.xaml
│ │ │ ├── GeometryButton.xaml
│ │ │ ├── CloseButton.xaml
│ │ │ └── ToggleStateButton.xaml
│ │ ├── Typography.xaml
│ │ ├── Colors
│ │ │ ├── CustomColors.xaml
│ │ │ ├── Colors.xaml
│ │ │ ├── BootstrapColors.xaml
│ │ │ └── MaterialDesignColors.xaml
│ │ ├── Generic.xaml
│ │ ├── Panels
│ │ │ ├── EmptyStatePanel.xaml
│ │ │ ├── AlertPanel.xaml
│ │ │ ├── CalloutPanel.xaml
│ │ │ └── ToolbarPanel.xaml
│ │ ├── Windows
│ │ │ └── ColorWindow.xaml
│ │ └── Controls
│ │ │ └── BannerMessageDialogControl.xaml
│ ├── Buttons
│ │ ├── WindowMinButton.cs
│ │ ├── ButtonMode.cs
│ │ ├── WindowCloseButton.cs
│ │ ├── WindowGoBackButton.cs
│ │ ├── VisibleButton.cs
│ │ ├── LockButton.cs
│ │ ├── CloseButton.cs
│ │ ├── WindowMaxButton.cs
│ │ ├── IconButton.cs
│ │ ├── ImageButton.cs
│ │ ├── GeometryButton.cs
│ │ ├── PathButton.cs
│ │ ├── ToggleStateButton.cs
│ │ ├── ModeButton.cs
│ │ └── DropDownIconButton.cs
│ ├── Utils
│ │ ├── BooleanBoxes.cs
│ │ └── DoubleUtils.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Acorisoft.UI.csproj
│ ├── Acorisoft - Backup.UI.csproj
│ ├── Directory.Build.nuspec
│ ├── Panels
│ │ ├── AlertPanel.cs
│ │ ├── CalloutPanel.cs
│ │ └── EmptyStatePanel.cs
│ ├── Controls
│ │ ├── TransparentComboBox.cs
│ │ ├── BulletControl.cs
│ │ └── BannerMessageDialogControl.cs
│ └── Windows
│ │ └── ColorWindow.cs
├── Acorisoft.UI.Host
│ ├── Acorisoft Team.ico
│ ├── App.xaml.cs
│ ├── Acorisoft.UI.Host.csproj
│ ├── Views
│ │ ├── CustomDemoCtl.xaml
│ │ ├── PanelDemoCtl.xaml.cs
│ │ ├── ButtonDemoCtl.xaml.cs
│ │ ├── CustomDemoCtl.xaml.cs
│ │ ├── DialogDemoCtl.xaml.cs
│ │ ├── ControlslDemoCtl.xaml.cs
│ │ ├── ControlslDemoCtl.xaml
│ │ └── PanelDemoCtl.xaml
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── App.xaml
│ ├── MainWindow.xaml.cs
│ └── MainWindow.xaml
└── Acorisoft.UI.Lesson
│ ├── Acorisoft.UI.Lesson.csproj
│ ├── AssemblyInfo.cs
│ ├── Themes
│ └── Generic.xaml
│ └── CustomControl1.cs
├── Documentations
├── Desire_Twitter_Message_Panel.png
└── Desire_Dribbble_Expandable_Panel.png
├── CustomControl_Lesson_2.md
├── CustomControl_Lesson_3.md
├── Directory.Build.props
├── LICENSE
├── Snippets
├── getseti.snippet
├── getset.snippet
├── routedevent.snippet
├── propdp.snippet
├── alignment.snippet
├── commandsource.snippet
├── supportIcon.snippet
├── contenttemplate.snippet
└── textelement.snippet
├── Readme-en.md
├── Acorisoft.UI.sln
├── .gitattributes
├── README.md
├── Button.md
├── CustomControl_Lesson_1.md
└── .gitignore
/Build/build.ps1:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Build/cake.config:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/icon_64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/icon_64x64.png
--------------------------------------------------------------------------------
/AcorisoftTeam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/AcorisoftTeam.png
--------------------------------------------------------------------------------
/Sponsor_Wechat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Sponsor_Wechat.jpg
--------------------------------------------------------------------------------
/Build/tools/nuget.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Build/tools/nuget.exe
--------------------------------------------------------------------------------
/Thumbnails/Buttons.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Buttons.gif
--------------------------------------------------------------------------------
/Thumbnails/Buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Buttons.png
--------------------------------------------------------------------------------
/Thumbnails/Panels.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Panels.gif
--------------------------------------------------------------------------------
/Thumbnails/AlertPanel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/AlertPanel.png
--------------------------------------------------------------------------------
/Thumbnails/CTA_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/CTA_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/ModeButton.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/ModeButton.gif
--------------------------------------------------------------------------------
/Thumbnails/CalloutPanel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/CalloutPanel.png
--------------------------------------------------------------------------------
/Thumbnails/Link_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Link_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/Solid_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Solid_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/ToolbarPanel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/ToolbarPanel.png
--------------------------------------------------------------------------------
/CustomControl_Lesson_1_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/CustomControl_Lesson_1_1.png
--------------------------------------------------------------------------------
/CustomControl_Lesson_1_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/CustomControl_Lesson_1_2.png
--------------------------------------------------------------------------------
/CustomControl_Lesson_1_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/CustomControl_Lesson_1_3.png
--------------------------------------------------------------------------------
/CustomControl_Lesson_1_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/CustomControl_Lesson_1_4.png
--------------------------------------------------------------------------------
/Thumbnails/FadeIn_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/FadeIn_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/FadeOut_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/FadeOut_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/Opacity_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Opacity_Button.gif
--------------------------------------------------------------------------------
/Thumbnails/Outline_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Outline_Button.gif
--------------------------------------------------------------------------------
/src/Acorisoft.UI/icon_64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/src/Acorisoft.UI/icon_64x64.png
--------------------------------------------------------------------------------
/Thumbnails/Transparency_Button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Thumbnails/Transparency_Button.gif
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Acorisoft Team.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/src/Acorisoft.UI.Host/Acorisoft Team.ico
--------------------------------------------------------------------------------
/Documentations/Desire_Twitter_Message_Panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Documentations/Desire_Twitter_Message_Panel.png
--------------------------------------------------------------------------------
/Build/tools/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Documentations/Desire_Dribbble_Expandable_Panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acorisoft/UI/HEAD/Documentations/Desire_Dribbble_Expandable_Panel.png
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Banner.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Lesson/Acorisoft.UI.Lesson.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 | true
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/WindowMinButton.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Acorisoft.UI.Buttons
4 | {
5 | public class WindowMinButton : ModeButton
6 | {
7 | static WindowMinButton()
8 | {
9 | DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowMinButton) , new FrameworkPropertyMetadata(typeof(WindowMinButton)));
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Acorisoft.UI.Host
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/ButtonMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Acorisoft.UI.Buttons
8 | {
9 | public enum ButtonMode
10 | {
11 | Solid,
12 | Outline,
13 | CTA,
14 | Opacity,
15 | Transparency,
16 | Link,
17 | FadeIn,
18 | FadeOut
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/WindowCloseButton.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls.Primitives;
3 |
4 | namespace Acorisoft.UI.Buttons
5 | {
6 | public class WindowCloseButton : ModeButton
7 | {
8 | static WindowCloseButton()
9 | {
10 | DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowCloseButton) , new FrameworkPropertyMetadata(typeof(WindowCloseButton)));
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CustomControl_Lesson_2.md:
--------------------------------------------------------------------------------
1 | # 从零开始创建自定义控件【二】
2 |
3 | ## 第一个控件
4 | ## 思考继承关系
5 | ## 设置自己需要的属性
6 | ### 依赖属性
7 | ### 依赖属性的定义
8 | ### 监听依赖属性的更改
9 | ### 监听依赖属性的强制更改
10 | ### 路由事件
11 | ### 路由事件的定义
12 | ### 路由事件的触发
13 |
14 |
15 | ## 引用
16 | * https://docs.microsoft.com/zh-cn/previous-versions/visualstudio/design-tools/expression-studio-4/cc295375(v=expression.40)?redirectedfrom=MSDN
17 |
18 |
19 | [上一篇](CustomControl_Lesson_1.md) [下一篇](CustomControl_Lesson_3.md)
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Utils/BooleanBoxes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Acorisoft
6 | {
7 | public static class BooleanBoxes
8 | {
9 | public static readonly object TrueBox = true;
10 |
11 | public static readonly object FalseBox = false;
12 |
13 | public static object Box(bool value)
14 | {
15 | if (value)
16 | {
17 | return TrueBox;
18 | }
19 | return FalseBox;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Build/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/CustomControl_Lesson_3.md:
--------------------------------------------------------------------------------
1 | # 从零开始创建自定义控件【三】
2 |
3 | ## XAML中定义元素
4 | ### 使用系统的元素
5 | ### 使用自己的元素
6 | ### Xmlns命名空间
7 | ### 解决外部程序集引用
8 | ## XAML中的绑定
9 | ### TemplateBinding
10 | ### Binding
11 | ### 不同绑定的适用范围
12 |
13 | * 想要实现TextBox内容更新的同时也更新控件的属性,请使用Binding
14 |
15 |
16 |
17 | ## 引用
18 | * https://docs.microsoft.com/zh-cn/previous-versions/visualstudio/design-tools/expression-studio-4/cc295375(v=expression.40)?redirectedfrom=MSDN
19 |
20 |
21 | [上一篇](CustomControl_Lesson_2.md) [下一篇](CustomControl_Lesson_4.md)
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Acorisoft.UI.Host.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net5.0-Windows
6 | true
7 | Acorisoft.UI.Host
8 | Acorisoft Team.ico
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/WindowGoBackButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace Acorisoft.UI.Buttons
9 | {
10 | public class WindowGoBackButton : ModeButton
11 | {
12 | static WindowGoBackButton()
13 | {
14 | DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowGoBackButton) , new FrameworkPropertyMetadata(typeof(WindowGoBackButton)));
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Markup;
3 |
4 | [assembly: ThemeInfo(ResourceDictionaryLocation.None , ResourceDictionaryLocation.SourceAssembly)]
5 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Buttons")]
6 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Controls")]
7 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Panels")]
8 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Windows")]
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/VisibleButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace Acorisoft.UI.Buttons
10 | {
11 | public class VisibleButton : ToggleStateButton
12 | {
13 | static VisibleButton()
14 | {
15 | DefaultStyleKeyProperty.OverrideMetadata(typeof(VisibleButton) , new FrameworkPropertyMetadata(typeof(VisibleButton)));
16 | }
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | Acoris;
4 | Acorisoft
5 | all right reserved by acoris
6 | True
7 | $(MSBuildThisFileDirectory)\Bin
8 | True
9 | Acorisoft
10 | net5.0-Windows
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Buttons/VisibleButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/CustomDemoCtl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Lesson/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None , //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Typography.xaml:
--------------------------------------------------------------------------------
1 |
4 | 36
5 | 30
6 | 24
7 | 18
8 | 16
9 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/PanelDemoCtl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Host.Views
17 | {
18 | ///
19 | /// PanelDemoCtl.xaml 的交互逻辑
20 | ///
21 | public partial class PanelDemoCtl : UserControl
22 | {
23 | public PanelDemoCtl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/ButtonDemoCtl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Host.Views
17 | {
18 | ///
19 | /// ButtonDemoCtl.xaml 的交互逻辑
20 | ///
21 | public partial class ButtonDemoCtl : UserControl
22 | {
23 | public ButtonDemoCtl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/CustomDemoCtl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Host.Views
17 | {
18 | ///
19 | /// CustomDemoCtl.xaml 的交互逻辑
20 | ///
21 | public partial class CustomDemoCtl : UserControl
22 | {
23 | public CustomDemoCtl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/DialogDemoCtl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Host.Views
17 | {
18 | ///
19 | /// DialogDemoCtl.xaml 的交互逻辑
20 | ///
21 | public partial class DialogDemoCtl : UserControl
22 | {
23 | public DialogDemoCtl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/ControlslDemoCtl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Host.Views
17 | {
18 | ///
19 | /// ControlDemoCtl.xaml 的交互逻辑
20 | ///
21 | public partial class ControlDemoCtl : UserControl
22 | {
23 | public ControlDemoCtl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Acorisoft.UI.Windows;
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.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace Acorisoft.UI.Host
18 | {
19 | ///
20 | /// Interaction logic for MainWindow.xaml
21 | ///
22 | public partial class MainWindow
23 | {
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Lesson/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
5 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/LockButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 | ///
19 | ///
20 | ///
21 | public class LockButton : ToggleStateButton
22 | {
23 | static LockButton()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(LockButton) ,
26 | new FrameworkPropertyMetadata(typeof(LockButton)));
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/CloseButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 | ///
19 | /// 表示一个关闭按钮
20 | ///
21 | public class CloseButton : Button
22 | {
23 | static CloseButton()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CloseButton) ,
26 | new FrameworkPropertyMetadata(typeof(CloseButton)));
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/WindowMaxButton.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Acorisoft.UI.Buttons
4 | {
5 | public class WindowMaxButton : ModeButton
6 | {
7 | static WindowMaxButton()
8 | {
9 | DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowMaxButton) , new FrameworkPropertyMetadata(typeof(WindowMaxButton)));
10 | }
11 |
12 |
13 | public WindowState WindowState
14 | {
15 | get => (WindowState)GetValue(WindowStateProperty);
16 | set => SetValue(WindowStateProperty , value);
17 | }
18 |
19 | public static readonly DependencyProperty WindowStateProperty = DependencyProperty.Register(
20 | "WindowState",
21 | typeof(WindowState),
22 | typeof(WindowMaxButton),
23 | new PropertyMetadata((object)WindowState.Normal));
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Acorisoft.UI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0-Windows;netcoreapp3.1
5 | true
6 | icon_64x64.png
7 | Acorisoft.UI
8 | MIT
9 | 1.2.5
10 | An custom ui library for acorisoft
11 | https://github.com/Acorisoft/UI
12 | https://github.com/Acorisoft/UI
13 | GITHUB
14 | False
15 | Acorisoft.UI
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Acorisoft - Backup.UI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0-Windows;netcoreapp3.1
5 | true
6 | icon_64x64.png
7 | Acorisoft.UI
8 | MIT
9 | 1.1.9
10 | An custom ui library for acorisoft
11 | https://github.com/Acorisoft/UI
12 | https://github.com/Acorisoft/UI
13 | GITHUB
14 | False
15 | Acorisoft.UI
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Directory.Build.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $id$
5 | $id$
6 | Acoris
7 | false
8 | $version$
9 | Acoris
10 | An custom ui library for acorisoft
11 | MIT
12 | MIT
13 | icon_64x64.png
14 | https://licenses.nuget.org/MIT
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Colors/CustomColors.xaml:
--------------------------------------------------------------------------------
1 |
3 | #6E00FF
4 | #FFAB01
5 | #1b809e
6 | #ce4844
7 | #aa6708
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Acorisoft
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Build/build.cake:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////
2 | // ARGUMENTS
3 | ///////////////////////////////////////////////////////////////////////////////
4 |
5 | var target = Argument("target", "Build");
6 | var configuration = Argument("configuration", "Release");
7 | var version = GitLabCI.Environment.Build.Id;
8 | ///////////////////////////////////////////////////////////////////////////////
9 | // SETUP / TEARDOWN
10 | ///////////////////////////////////////////////////////////////////////////////
11 |
12 | Setup(ctx =>
13 | {
14 | // Executed BEFORE the first task.
15 | Information("Running tasks...");
16 | });
17 |
18 | Teardown(ctx =>
19 | {
20 | // Executed AFTER the last task.
21 | Information("Finished running tasks.");
22 | });
23 |
24 | ///////////////////////////////////////////////////////////////////////////////
25 | // TASKS
26 | ///////////////////////////////////////////////////////////////////////////////
27 |
28 | Task("Default")
29 | .Does(() => {
30 | Information(version);
31 | });
32 |
33 | Task("Clean")
34 | .Does(()=>{
35 | CleanDirectory("");
36 | });
37 |
38 | RunTarget(target);
--------------------------------------------------------------------------------
/Snippets/getseti.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | getseti
9 |
10 |
11 |
12 |
13 |
14 |
15 | getseti
16 |
17 |
18 |
19 |
20 | type
21 | type
22 | type
23 |
24 |
25 |
26 |
27 | name
28 | name
29 | name
30 |
31 |
32 |
33 |
34 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/IconButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 |
19 | public class IconButton : PathButton
20 | {
21 | static IconButton()
22 | {
23 | DefaultStyleKeyProperty.OverrideMetadata(typeof(IconButton) , new FrameworkPropertyMetadata(typeof(IconButton)));
24 | }
25 |
26 |
27 | public Dock Dock
28 | {
29 | get => (Dock)GetValue(DockProperty);
30 | set => SetValue(DockProperty , value);
31 | }
32 |
33 | public static readonly DependencyProperty DockProperty = DependencyProperty.Register(
34 | "Dock",
35 | typeof(Dock),
36 | typeof(IconButton),
37 | new PropertyMetadata(null));
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/ImageButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 | public class ImageButton : ModeButton
19 | {
20 | static ImageButton()
21 | {
22 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton) ,
23 | new FrameworkPropertyMetadata(typeof(ImageButton)));
24 | }
25 |
26 |
27 | public ImageSource Image
28 | {
29 | get => (ImageSource)GetValue(ImageProperty);
30 | set => SetValue(ImageProperty , value);
31 | }
32 |
33 | public static readonly DependencyProperty ImageProperty = DependencyProperty.Register(
34 | "Image",
35 | typeof(ImageSource),
36 | typeof(ImageButton),
37 | new PropertyMetadata(null));
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Snippets/getset.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | getset
9 |
10 |
11 |
12 |
13 |
14 |
15 | getset
16 |
17 |
18 |
19 |
20 | type
21 | type
22 | type
23 |
24 |
25 |
26 |
27 | name
28 | name
29 | name
30 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Panels/AlertPanel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Panels
17 | {
18 | public enum Alert
19 | {
20 | Custom,
21 | Info,
22 | Success,
23 | Warning,
24 | Danger
25 | }
26 |
27 | ///
28 | /// 警告按钮
29 | ///
30 | public class AlertPanel : ContentControl
31 | {
32 | static AlertPanel()
33 | {
34 | DefaultStyleKeyProperty.OverrideMetadata(typeof(AlertPanel) ,
35 | new FrameworkPropertyMetadata(typeof(AlertPanel)));
36 | }
37 |
38 |
39 | public Alert Alert
40 | {
41 | get => (Alert)GetValue(AlertProperty);
42 | set => SetValue(AlertProperty , value);
43 | }
44 |
45 | public static readonly DependencyProperty AlertProperty = DependencyProperty.Register(
46 | "Alert",
47 | typeof(Alert),
48 | typeof(AlertPanel),
49 | new PropertyMetadata(null));
50 |
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Snippets/routedevent.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | routedevent
9 |
10 |
11 |
12 |
13 |
14 |
15 | routedevent
16 |
17 |
18 |
19 |
20 | Name
21 | Name
22 | Name
23 |
24 |
25 |
26 |
27 | Type
28 | Type
29 | Type
30 |
31 |
32 |
33 |
34 | class
35 | class
36 | class
37 |
38 |
39 |
40 |
41 | AddHandler($Name$Event, value);
47 | remove => RemoveHandler($Name$Event, value);
48 | }]]>
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Snippets/propdp.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | propdp
9 |
10 |
11 |
12 |
13 |
14 |
15 | propdp
16 |
17 |
18 |
19 |
20 | type
21 | 依赖项属性类型
22 | type
23 |
24 |
25 |
26 |
27 | property
28 | 依赖项属性名
29 | property
30 |
31 |
32 |
33 |
34 | class
35 | 依赖项属性的所有者
36 | class
37 |
38 |
39 |
40 |
41 | ($type$)GetValue($property$Property);
44 | set => SetValue($property$Property, value);
45 | }
46 |
47 | public static readonly DependencyProperty $property$Property = DependencyProperty.Register(
48 | "$property$",
49 | typeof($type$),
50 | typeof($class$),
51 | new PropertyMetadata(null));
52 | ]]>
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Lesson/CustomControl1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Lesson
17 | {
18 | ///
19 | /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
20 | ///
21 | /// Step 1a) Using this custom control in a XAML file that exists in the current project.
22 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
23 | /// to be used:
24 | ///
25 | /// xmlns:MyNamespace="clr-namespace:Acorisoft.UI.Lesson"
26 | ///
27 | ///
28 | /// Step 1b) Using this custom control in a XAML file that exists in a different project.
29 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
30 | /// to be used:
31 | ///
32 | /// xmlns:MyNamespace="clr-namespace:Acorisoft.UI.Lesson;assembly=Acorisoft.UI.Lesson"
33 | ///
34 | /// You will also need to add a project reference from the project where the XAML file lives
35 | /// to this project and Rebuild to avoid compilation errors:
36 | ///
37 | /// Right click on the target project in the Solution Explorer and
38 | /// "Add Reference"->"Projects"->[Select this project]
39 | ///
40 | ///
41 | /// Step 2)
42 | /// Go ahead and use your control in the XAML file.
43 | ///
44 | ///
45 | ///
46 | ///
47 | public class CustomControl1 : Control
48 | {
49 | static CustomControl1()
50 | {
51 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1) , new FrameworkPropertyMetadata(typeof(CustomControl1)));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Readme-en.md:
--------------------------------------------------------------------------------
1 | # Acorisoft.UI
2 |
3 | ## What was Acorisoft.UI
4 |
5 | we decide to developing a ui library which contain rich widgets,templates,layout or control rather than ui themes,that you can use it to any ui theme such as `MaterialDesignInXamlToolKits` or `MahApps` or `HandyControl` etc.
6 |
7 | ## How to use it
8 |
9 | just copy it to `App.xaml`
10 |
11 | ``` XAML
12 |
13 |
14 |
15 |
16 |
17 |
18 | ```
19 |
20 | ## How to contribute
21 |
22 | if you findsome templates or widget which you want it,you can push the widget image to `Documentations` folder
23 |
24 |
25 | ## Notice
26 | this library work for `.NET 5`,and we not decide to support `.net framework`.
27 |
28 | ## ControlGallery
29 |
30 | ### Button
31 |
32 | 
33 |
34 | 在未来的版本中将会加入一些常用的按钮,这些按钮通过继承的形式实现,不会因为项目中添加了其他的样式类库而产生冲突,而这些按钮相较于`Button` 类型多了以下属性:
35 |
36 | |类型 | 属性 | 属性类型 | 备注 |
37 | |:----------:|:--------------:| :--------:|:---------------------|
38 | | ModeButton | Mode | ButtonMode| 设置按钮模式,共有6种模式|
39 | | PathButton | Icon | Geometry | 设置图标 |
40 | | PathButton | IconWidth | double | 设置图标的宽度 |
41 | | PathButton | IconHeight | double | 设置图标的高度 |
42 | | PathButton | IconPadding | Thickness | 设置图标的内边距 |
43 | | PathButton | IconThickness | double | 设置图标的边缘大小 |
44 | | IconButton | Dock | Dock | 设置图标的停靠位置 |
45 |
46 | #### Roadmap
47 |
48 | * ModeButton 用于提供普通文本按钮样式支持
49 | * PathButton 用于提供路径按钮样式支持
50 | * IconButton 用于提供文本图标按钮样式支持
51 | * FloatingButton 用于提供圆形浮空按钮样式支持
52 |
53 | ### ToolbarPanel
54 |
55 | 
56 | ### CalloutPanel
57 |
58 | 
59 |
60 | ### AlertPanel
61 |
62 | 
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Buttons/LockButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
20 |
21 |
22 |
23 |
33 |
--------------------------------------------------------------------------------
/Snippets/alignment.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | alignment
9 |
10 |
11 |
12 |
13 |
14 |
15 | alignment
16 |
17 |
18 |
19 |
20 | Name
21 | Name
22 | Name
23 |
24 |
25 |
26 |
27 | Type
28 | Type
29 | Type
30 |
31 |
32 |
33 |
34 | (HorizontalAlignment)GetValue(Horizontal$Name$AlignmentProperty);
37 | set => SetValue(Horizontal$Name$AlignmentProperty , value);
38 | }
39 |
40 |
41 | public VerticalAlignment Vertical$Name$Alignment
42 | {
43 | get => (VerticalAlignment)GetValue(Vertical$Name$AlignmentProperty);
44 | set => SetValue(Vertical$Name$AlignmentProperty , value);
45 | }
46 |
47 | public static readonly DependencyProperty Horizontal$Name$AlignmentProperty = DependencyProperty.Register(
48 | "Horizontal$Name$Alignment",
49 | typeof(HorizontalAlignment),
50 | typeof($Type$),
51 | new PropertyMetadata(null));
52 |
53 | public static readonly DependencyProperty Vertical$Name$AlignmentProperty = DependencyProperty.Register(
54 | "Vertical$Name$Alignment",
55 | typeof(VerticalAlignment),
56 | typeof($Type$),
57 | new PropertyMetadata(null));]]>
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Acorisoft.UI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30516.212
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acorisoft.UI", "src\Acorisoft.UI\Acorisoft.UI.csproj", "{0DB8C6E5-BF69-4CF7-B84A-D5E602D7C5A9}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acorisoft.UI.Host", "src\Acorisoft.UI.Host\Acorisoft.UI.Host.csproj", "{AF9AEBBA-F7B1-443C-BA1C-0F99452FE3EE}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acorisoft.UI.Lesson", "src\Acorisoft.UI.Lesson\Acorisoft.UI.Lesson.csproj", "{5E5123D6-44A7-4977-8CAB-3807C33A7CBF}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {0DB8C6E5-BF69-4CF7-B84A-D5E602D7C5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {0DB8C6E5-BF69-4CF7-B84A-D5E602D7C5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {0DB8C6E5-BF69-4CF7-B84A-D5E602D7C5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {0DB8C6E5-BF69-4CF7-B84A-D5E602D7C5A9}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {AF9AEBBA-F7B1-443C-BA1C-0F99452FE3EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {AF9AEBBA-F7B1-443C-BA1C-0F99452FE3EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {AF9AEBBA-F7B1-443C-BA1C-0F99452FE3EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {AF9AEBBA-F7B1-443C-BA1C-0F99452FE3EE}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {5E5123D6-44A7-4977-8CAB-3807C33A7CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {5E5123D6-44A7-4977-8CAB-3807C33A7CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {5E5123D6-44A7-4977-8CAB-3807C33A7CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {5E5123D6-44A7-4977-8CAB-3807C33A7CBF}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {9E2EC54F-56EF-4E54-837B-9FC853092C7C}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Controls/TransparentComboBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Controls
17 | {
18 | ///
19 | /// 透明组合框
20 | ///
21 | public class TransparentComboBox : ComboBox
22 | {
23 | static TransparentComboBox()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(TransparentComboBox) ,
26 | new FrameworkPropertyMetadata(typeof(TransparentComboBox)));
27 | }
28 |
29 |
30 | public Thickness ItemsPadding
31 | {
32 | get => (Thickness)GetValue(ItemsPaddingProperty);
33 | set => SetValue(ItemsPaddingProperty , value);
34 | }
35 |
36 | public Brush PanelForeground
37 | {
38 | get => (Brush)GetValue(PanelForegroundProperty);
39 | set => SetValue(PanelForegroundProperty , value);
40 | }
41 |
42 |
43 | public double IconSize
44 | {
45 | get => (double)GetValue(IconSizeProperty);
46 | set => SetValue(IconSizeProperty , value);
47 | }
48 |
49 | public static readonly DependencyProperty IconSizeProperty = DependencyProperty.Register(
50 | "IconSize",
51 | typeof(double),
52 | typeof(TransparentComboBox),
53 | new PropertyMetadata(null));
54 |
55 | public static readonly DependencyProperty ItemsPaddingProperty = DependencyProperty.Register(
56 | "ItemsPadding",
57 | typeof(Thickness),
58 | typeof(TransparentComboBox),
59 | new PropertyMetadata(null));
60 |
61 |
62 | public static readonly DependencyProperty PanelForegroundProperty = DependencyProperty.Register(
63 | "PanelForeground",
64 | typeof(Brush),
65 | typeof(TransparentComboBox),
66 | new PropertyMetadata(null));
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Colors/Colors.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | #000000
7 | #FFFFFF
8 | #F5F5F5
9 | #AA000000
10 | #3F51B5
11 | #303F9F
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | #30000000
21 | #30FFFFFF
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Snippets/commandsource.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | commandsource
9 |
10 |
11 |
12 |
13 |
14 |
15 | commandsource
16 |
17 |
18 |
19 |
20 | name
21 | name
22 | name
23 |
24 |
25 |
26 |
27 | type
28 | type
29 | type
30 |
31 |
32 |
33 |
34 | (ICommand)GetValue($name$CommandProperty);
37 | set => SetValue($name$CommandProperty, value);
38 | }
39 |
40 | public object $name$CommandParameter
41 | {
42 | get => (object)GetValue($name$CommandParameterProperty);
43 | set => SetValue($name$CommandParameterProperty, value);
44 | }
45 | public IInputElement $name$CommandTarget
46 | {
47 | get => (IInputElement)GetValue($name$CommandTargetProperty);
48 | set => SetValue($name$CommandTargetProperty, value);
49 | }
50 |
51 | public static readonly DependencyProperty $name$CommandTargetProperty = DependencyProperty.Register(
52 | "$name$CommandTarget",
53 | typeof(IInputElement),
54 | typeof($type$),
55 | new PropertyMetadata(null));
56 |
57 |
58 | public static readonly DependencyProperty $name$CommandParameterProperty = DependencyProperty.Register(
59 | "$name$CommandParameter",
60 | typeof(object),
61 | typeof($type$),
62 | new PropertyMetadata(null));
63 |
64 | public static readonly DependencyProperty $name$CommandProperty = DependencyProperty.Register(
65 | "$name$Command",
66 | typeof(ICommand),
67 | typeof($type$),
68 | new PropertyMetadata(null));]]>
69 |
70 |
71 |
--------------------------------------------------------------------------------
/Snippets/supportIcon.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | supportIcon
9 |
10 |
11 |
12 |
13 |
14 |
15 | icon
16 |
17 |
18 |
19 |
20 | class
21 | class
22 | class
23 |
24 |
25 |
26 |
27 | (Geometry)GetValue(IconProperty);
30 | set => SetValue(IconProperty , value);
31 | }
32 |
33 | public double IconWidth
34 | {
35 | get => (double)GetValue(IconWidthProperty);
36 | set => SetValue(IconWidthProperty , value);
37 | }
38 | public double IconHeight
39 | {
40 | get => (double)GetValue(IconHeightProperty);
41 | set => SetValue(IconHeightProperty , value);
42 | }
43 |
44 | public Thickness IconPadding
45 | {
46 | get => (Thickness)GetValue(IconPaddingProperty);
47 | set => SetValue(IconPaddingProperty , value);
48 | }
49 |
50 | public static readonly DependencyProperty IconPaddingProperty = DependencyProperty.Register(
51 | "IconPadding",
52 | typeof(Thickness),
53 | typeof($class$),
54 | new PropertyMetadata(null));
55 |
56 | public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register(
57 | "IconHeight",
58 | typeof(double),
59 | typeof($class$),
60 | new PropertyMetadata(null));
61 |
62 |
63 | public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(
64 | "IconWidth",
65 | typeof(double),
66 | typeof($class$),
67 | new PropertyMetadata(null));
68 |
69 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
70 | "Icon",
71 | typeof(Geometry),
72 | typeof($class$),
73 | new PropertyMetadata(null));
74 | ]]>
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/GeometryButton.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Media;
4 |
5 | namespace Acorisoft.UI.Buttons
6 | {
7 | public class GeometryButton : Button
8 | {
9 | static GeometryButton()
10 | {
11 | DefaultStyleKeyProperty.OverrideMetadata(typeof(GeometryButton) , new FrameworkPropertyMetadata(typeof(GeometryButton)));
12 | }
13 |
14 | public Geometry Icon
15 | {
16 | get => (Geometry)GetValue(IconProperty);
17 | set => SetValue(IconProperty , value);
18 | }
19 |
20 | public double IconWidth
21 | {
22 | get => (double)GetValue(IconWidthProperty);
23 | set => SetValue(IconWidthProperty , value);
24 | }
25 |
26 | public double IconHeight
27 | {
28 | get => (double)GetValue(IconHeightProperty);
29 | set => SetValue(IconHeightProperty , value);
30 | }
31 |
32 | public Thickness IconPadding
33 | {
34 | get => (Thickness)GetValue(IconPaddingProperty);
35 | set => SetValue(IconPaddingProperty , value);
36 | }
37 |
38 | public double IconThickness
39 | {
40 | get => (double)GetValue(IconThicknessProperty);
41 | set => SetValue(IconThicknessProperty , value);
42 | }
43 |
44 | public static readonly DependencyProperty IconThicknessProperty = DependencyProperty.Register(
45 | "IconThickness",
46 | typeof(double),
47 | typeof(GeometryButton),
48 | new PropertyMetadata(1d));
49 |
50 | public static readonly DependencyProperty IconPaddingProperty = DependencyProperty.Register(
51 | "IconPadding",
52 | typeof(Thickness),
53 | typeof(GeometryButton),
54 | new PropertyMetadata(null));
55 |
56 | public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register(
57 | "IconHeight",
58 | typeof(double),
59 | typeof(GeometryButton),
60 | new PropertyMetadata(null));
61 |
62 | public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(
63 | "IconWidth",
64 | typeof(double),
65 | typeof(GeometryButton),
66 | new PropertyMetadata(null));
67 |
68 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
69 | "Icon",
70 | typeof(Geometry),
71 | typeof(GeometryButton),
72 | new PropertyMetadata(null));
73 |
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Buttons/GeometryButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
45 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/ControlslDemoCtl.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
13 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/PathButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 |
19 | public class PathButton : ModeButton
20 | {
21 | static PathButton()
22 | {
23 | DefaultStyleKeyProperty.OverrideMetadata(typeof(PathButton) ,
24 | new FrameworkPropertyMetadata(typeof(PathButton)));
25 | }
26 |
27 |
28 | public Geometry Icon
29 | {
30 | get => (Geometry)GetValue(IconProperty);
31 | set => SetValue(IconProperty , value);
32 | }
33 |
34 | public double IconWidth
35 | {
36 | get => (double)GetValue(IconWidthProperty);
37 | set => SetValue(IconWidthProperty , value);
38 | }
39 |
40 | public double IconHeight
41 | {
42 | get => (double)GetValue(IconHeightProperty);
43 | set => SetValue(IconHeightProperty , value);
44 | }
45 |
46 | public Thickness IconPadding
47 | {
48 | get => (Thickness)GetValue(IconPaddingProperty);
49 | set => SetValue(IconPaddingProperty , value);
50 | }
51 |
52 | public double IconThickness
53 | {
54 | get => (double)GetValue(IconThicknessProperty);
55 | set => SetValue(IconThicknessProperty , value);
56 | }
57 |
58 | public static readonly DependencyProperty IconThicknessProperty = DependencyProperty.Register(
59 | "IconThickness",
60 | typeof(double),
61 | typeof(PathButton),
62 | new PropertyMetadata(1d));
63 |
64 | public static readonly DependencyProperty IconPaddingProperty = DependencyProperty.Register(
65 | "IconPadding",
66 | typeof(Thickness),
67 | typeof(PathButton),
68 | new PropertyMetadata(null));
69 |
70 | public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register(
71 | "IconHeight",
72 | typeof(double),
73 | typeof(PathButton),
74 | new PropertyMetadata(null));
75 |
76 | public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(
77 | "IconWidth",
78 | typeof(double),
79 | typeof(PathButton),
80 | new PropertyMetadata(null));
81 |
82 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
83 | "Icon",
84 | typeof(Geometry),
85 | typeof(PathButton),
86 | new PropertyMetadata(null));
87 |
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/Snippets/contenttemplate.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | contenttemplate
9 |
10 |
11 |
12 |
13 |
14 |
15 | contenttemplate
16 |
17 |
18 |
19 |
20 | name
21 | name
22 | name
23 |
24 |
25 |
26 |
27 | type
28 | type
29 | type
30 |
31 |
32 |
33 |
34 | (object)GetValue($name$Property);
37 | set => SetValue($name$Property, value);
38 | }
39 |
40 | public DataTemplate $name$Template
41 | {
42 | get => (DataTemplate)GetValue($name$TemplateProperty);
43 | set => SetValue($name$TemplateProperty, value);
44 | }
45 |
46 | public DataTemplateSelector $name$TemplateSelector
47 | {
48 | get => (DataTemplateSelector)GetValue($name$TemplateSelectorProperty);
49 | set => SetValue($name$TemplateSelectorProperty, value);
50 | }
51 |
52 |
53 | public string $name$StringFormat
54 | {
55 | get => (string)GetValue($name$StringFormatProperty);
56 | set => SetValue($name$StringFormatProperty, value);
57 | }
58 |
59 | public static readonly DependencyProperty $name$StringFormatProperty = DependencyProperty.Register(
60 | "$name$StringFormat",
61 | typeof(string),
62 | typeof($type$),
63 | new PropertyMetadata(null));
64 |
65 | public static readonly DependencyProperty $name$TemplateSelectorProperty = DependencyProperty.Register(
66 | "$name$TemplateSelector",
67 | typeof(DataTemplateSelector),
68 | typeof($type$),
69 | new PropertyMetadata(null));
70 |
71 | public static readonly DependencyProperty $name$TemplateProperty = DependencyProperty.Register(
72 | "$name$Template",
73 | typeof(DataTemplate),
74 | typeof($type$),
75 | new PropertyMetadata(null));
76 |
77 | public static readonly DependencyProperty $name$Property = DependencyProperty.Register(
78 | "$name$",
79 | typeof(object),
80 | typeof($type$),
81 | new PropertyMetadata(null));]]>
82 |
83 |
84 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Panels/CalloutPanel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Panels
17 | {
18 | ///
19 | /// 呼吁面板
20 | ///
21 | public class CalloutPanel : ContentControl
22 | {
23 | static CalloutPanel()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CalloutPanel) ,
26 | new FrameworkPropertyMetadata(typeof(CalloutPanel)));
27 | }
28 |
29 |
30 | public Brush CalloutColor
31 | {
32 | get => (Brush)GetValue(CalloutColorProperty);
33 | set => SetValue(CalloutColorProperty , value);
34 | }
35 |
36 | public object Callout
37 | {
38 | get => (object)GetValue(CalloutProperty);
39 | set => SetValue(CalloutProperty , value);
40 | }
41 |
42 | public DataTemplate CalloutTemplate
43 | {
44 | get => (DataTemplate)GetValue(CalloutTemplateProperty);
45 | set => SetValue(CalloutTemplateProperty , value);
46 | }
47 |
48 | public DataTemplateSelector CalloutTemplateSelector
49 | {
50 | get => (DataTemplateSelector)GetValue(CalloutTemplateSelectorProperty);
51 | set => SetValue(CalloutTemplateSelectorProperty , value);
52 | }
53 |
54 |
55 | public string CalloutStringFormat
56 | {
57 | get => (string)GetValue(CalloutStringFormatProperty);
58 | set => SetValue(CalloutStringFormatProperty , value);
59 | }
60 |
61 | public static readonly DependencyProperty CalloutStringFormatProperty = DependencyProperty.Register(
62 | "CalloutStringFormat",
63 | typeof(string),
64 | typeof(CalloutPanel),
65 | new PropertyMetadata(null));
66 |
67 | public static readonly DependencyProperty CalloutTemplateSelectorProperty = DependencyProperty.Register(
68 | "CalloutTemplateSelector",
69 | typeof(DataTemplateSelector),
70 | typeof(CalloutPanel),
71 | new PropertyMetadata(null));
72 |
73 | public static readonly DependencyProperty CalloutTemplateProperty = DependencyProperty.Register(
74 | "CalloutTemplate",
75 | typeof(DataTemplate),
76 | typeof(CalloutPanel),
77 | new PropertyMetadata(null));
78 |
79 | public static readonly DependencyProperty CalloutProperty = DependencyProperty.Register(
80 | "Callout",
81 | typeof(object),
82 | typeof(CalloutPanel),
83 | new PropertyMetadata(null));
84 |
85 | public static readonly DependencyProperty CalloutColorProperty = DependencyProperty.Register(
86 | "CalloutColor",
87 | typeof(Brush),
88 | typeof(CalloutPanel),
89 | new PropertyMetadata(null));
90 |
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
39 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
54 |
56 |
58 |
60 |
62 |
63 |
64 |
65 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Colors/BootstrapColors.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 | #004085
7 | #cce5ff
8 | #b8daff
9 | #383d41
10 | #e2e3e5
11 | #d6d8db
12 | #155724
13 | #d4edda
14 | #c3e6cb
15 | #721c24
16 | #f8d7da
17 | #f5c6cb
18 | #856404
19 | #fff3cd
20 | #ffeeba
21 | #0c5460
22 | #d1ecf1
23 | #bee5eb
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
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 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Panels/EmptyStatePanel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Panels
17 | {
18 | public class EmptyStatePanel : ContentControl
19 | {
20 | static EmptyStatePanel()
21 | {
22 | DefaultStyleKeyProperty.OverrideMetadata(typeof(EmptyStatePanel) , new FrameworkPropertyMetadata(typeof(EmptyStatePanel)));
23 | }
24 |
25 |
26 | public bool HasItems
27 | {
28 | get => (bool)GetValue(HasItemsProperty);
29 | set => SetValue(HasItemsProperty , value);
30 | }
31 |
32 | public object Alternative
33 | {
34 | get => (object)GetValue(AlternativeProperty);
35 | set => SetValue(AlternativeProperty , value);
36 | }
37 |
38 | public DataTemplate AlternativeTemplate
39 | {
40 | get => (DataTemplate)GetValue(AlternativeTemplateProperty);
41 | set => SetValue(AlternativeTemplateProperty , value);
42 | }
43 |
44 | public DataTemplateSelector AlternativeTemplateSelector
45 | {
46 | get => (DataTemplateSelector)GetValue(AlternativeTemplateSelectorProperty);
47 | set => SetValue(AlternativeTemplateSelectorProperty , value);
48 | }
49 |
50 |
51 | public string AlternativeStringFormat
52 | {
53 | get => (string)GetValue(AlternativeStringFormatProperty);
54 | set => SetValue(AlternativeStringFormatProperty , value);
55 | }
56 |
57 | public static readonly DependencyProperty AlternativeStringFormatProperty = DependencyProperty.Register(
58 | "AlternativeStringFormat",
59 | typeof(string),
60 | typeof(EmptyStatePanel),
61 | new PropertyMetadata(null));
62 |
63 | public static readonly DependencyProperty AlternativeTemplateSelectorProperty = DependencyProperty.Register(
64 | "AlternativeTemplateSelector",
65 | typeof(DataTemplateSelector),
66 | typeof(EmptyStatePanel),
67 | new PropertyMetadata(null));
68 |
69 | public static readonly DependencyProperty AlternativeTemplateProperty = DependencyProperty.Register(
70 | "AlternativeTemplate",
71 | typeof(DataTemplate),
72 | typeof(EmptyStatePanel),
73 | new PropertyMetadata(null));
74 |
75 | public static readonly DependencyProperty AlternativeProperty = DependencyProperty.Register(
76 | "Alternative",
77 | typeof(object),
78 | typeof(EmptyStatePanel),
79 | new PropertyMetadata(null));
80 | public static readonly DependencyProperty HasItemsProperty = DependencyProperty.Register(
81 | "HasItems",
82 | typeof(bool),
83 | typeof(EmptyStatePanel),
84 | new PropertyMetadata(true,OnHasItemsChanged));
85 |
86 | private static void OnHasItemsChanged(DependencyObject d , DependencyPropertyChangedEventArgs e)
87 | {
88 | d.SetCurrentValue(HasItemsProperty , BooleanBoxes.Box((bool)e.NewValue));
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/ToggleStateButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 | public class ToggleStateButton : CheckBox
19 | {
20 | static ToggleStateButton()
21 | {
22 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ToggleStateButton) , new FrameworkPropertyMetadata(typeof(ToggleStateButton)));
23 | }
24 |
25 |
26 | public Geometry TrueState
27 | {
28 | get => (Geometry)GetValue(TrueStateProperty);
29 | set => SetValue(TrueStateProperty , value);
30 | }
31 |
32 |
33 | public Geometry FalseState
34 | {
35 | get => (Geometry)GetValue(FalseStateProperty);
36 | set => SetValue(FalseStateProperty , value);
37 | }
38 |
39 | public double IconWidth
40 | {
41 | get => (double)GetValue(IconWidthProperty);
42 | set => SetValue(IconWidthProperty , value);
43 | }
44 |
45 | public double IconHeight
46 | {
47 | get => (double)GetValue(IconHeightProperty);
48 | set => SetValue(IconHeightProperty , value);
49 | }
50 |
51 | public Thickness IconPadding
52 | {
53 | get => (Thickness)GetValue(IconPaddingProperty);
54 | set => SetValue(IconPaddingProperty , value);
55 | }
56 |
57 |
58 | public double IconThickness
59 | {
60 | get => (double)GetValue(IconThicknessProperty);
61 | set => SetValue(IconThicknessProperty , value);
62 | }
63 |
64 | public static readonly DependencyProperty IconThicknessProperty = DependencyProperty.Register(
65 | "IconThickness",
66 | typeof(double),
67 | typeof(ToggleStateButton),
68 | new PropertyMetadata(null));
69 |
70 |
71 | public static readonly DependencyProperty IconPaddingProperty = DependencyProperty.Register(
72 | "IconPadding",
73 | typeof(Thickness),
74 | typeof(ToggleStateButton),
75 | new PropertyMetadata(null));
76 |
77 | public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register(
78 | "IconHeight",
79 | typeof(double),
80 | typeof(ToggleStateButton),
81 | new PropertyMetadata(null));
82 |
83 | public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(
84 | "IconWidth",
85 | typeof(double),
86 | typeof(ToggleStateButton),
87 | new PropertyMetadata(null));
88 |
89 | public static readonly DependencyProperty FalseStateProperty = DependencyProperty.Register(
90 | "FalseState",
91 | typeof(Geometry),
92 | typeof(ToggleStateButton),
93 | new PropertyMetadata(null));
94 |
95 |
96 | public static readonly DependencyProperty TrueStateProperty = DependencyProperty.Register(
97 | "TrueState",
98 | typeof(Geometry),
99 | typeof(ToggleStateButton),
100 | new PropertyMetadata(null));
101 |
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/ModeButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Buttons
17 | {
18 | public class ModeButton : Button
19 | {
20 | private static readonly object DefaultCornerRadius = new CornerRadius(8);
21 |
22 | static ModeButton()
23 | {
24 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ModeButton) , new FrameworkPropertyMetadata(typeof(ModeButton)));
25 | }
26 |
27 |
28 | public CornerRadius CornerRadius
29 | {
30 | get => (CornerRadius)GetValue(CornerRadiusProperty);
31 | set => SetValue(CornerRadiusProperty , value);
32 | }
33 |
34 | public Brush HoverBackgroundBrush
35 | {
36 | get => (Brush)GetValue(HoverBackgroundBrushProperty);
37 | set => SetValue(HoverBackgroundBrushProperty , value);
38 | }
39 |
40 | public Brush HoverForegroundBrush
41 | {
42 | get => (Brush)GetValue(HoverForegroundBrushProperty);
43 | set => SetValue(HoverForegroundBrushProperty , value);
44 | }
45 |
46 | public Brush PressBackgroundBrush
47 | {
48 | get => (Brush)GetValue(PressBackgroundBrushProperty);
49 | set => SetValue(PressBackgroundBrushProperty , value);
50 | }
51 |
52 | public Brush PressForegroundBrush
53 | {
54 | get => (Brush)GetValue(PressForegroundBrushProperty);
55 | set => SetValue(PressForegroundBrushProperty , value);
56 | }
57 |
58 | public ButtonMode Mode
59 | {
60 | get => (ButtonMode)GetValue(ModeProperty);
61 | set => SetValue(ModeProperty , value);
62 | }
63 |
64 | public static readonly DependencyProperty ModeProperty = DependencyProperty.Register(
65 | "Mode",
66 | typeof(ButtonMode),
67 | typeof(ModeButton),
68 | new PropertyMetadata(null));
69 |
70 |
71 | public static readonly DependencyProperty PressForegroundBrushProperty = DependencyProperty.Register(
72 | "PressForegroundBrush",
73 | typeof(Brush),
74 | typeof(ModeButton),
75 | new PropertyMetadata(null));
76 |
77 | public static readonly DependencyProperty PressBackgroundBrushProperty = DependencyProperty.Register(
78 | "PressBackgroundBrush",
79 | typeof(Brush),
80 | typeof(ModeButton),
81 | new PropertyMetadata(null));
82 |
83 | public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(
84 | "CornerRadius",
85 | typeof(CornerRadius),
86 | typeof(ModeButton),
87 | new PropertyMetadata(DefaultCornerRadius));
88 |
89 | public static readonly DependencyProperty HoverForegroundBrushProperty = DependencyProperty.Register(
90 | "HoverForegroundBrush",
91 | typeof(Brush),
92 | typeof(ModeButton),
93 | new PropertyMetadata(null));
94 |
95 | public static readonly DependencyProperty HoverBackgroundBrushProperty = DependencyProperty.Register(
96 | "HoverBackgroundBrush",
97 | typeof(Brush),
98 | typeof(ModeButton),
99 | new PropertyMetadata(null));
100 |
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [English](Readme-en.md) [Chinese](README.md)
2 |
3 |   
4 |
5 | 
6 |
7 | # `Acorisoft.UI`
8 |
9 | `Acorisoft.UI` 类库旨在为开发者带来丰富的布局、组件,让您在开发的时候能够更方便、更快捷、更高效的创建界面,而非忍受大量重复的造轮子。这个项目的初衷不是为开发者带来丰富的样式,而是为用户提供独立不受第三方样式影响的组件和布局,您可以放心的混用不同第三方的界面库,例如`MaterialDesignInXamlToolKits`或者`MahApps`以及`HandyControl`。我们只是为这些类库提供一些拓展的组件和布局。
10 |
11 | ### 加入讨论
12 |
13 | | | 西江月群 | 定风波群 | 广寒秋群 |
14 | |-|:-:|:-:|:-:|
15 | | 群号码 | [](//shang.qq.com/wpa/qunwpa?idkey=a571e5553c9d41e49c4f22f3a8b2865451497a795ff281fedf3285def247efc1) | [](//shang.qq.com/wpa/qunwpa?idkey=5c18622a0f6ee07a6f33afa8cdb85b1f72ea50e878271dfcec919c76b55afee7) | 微信群 |
16 | | 二维码 |  |  |  |
17 |
18 |
19 | ## 协作(Contribute)
20 |
21 | 目前这个类库不想支持`.NET Framework`,如果您有支持`FX`的需求,这边建议您Fork本项目,并自行创建项目解决方案引用本项目文件。本项目目前没有使用到`Task` `await` 等类型或者关键字,理论来说一次性编译成功的几率是100%。
22 |
23 | ### 环境
24 |
25 | * VisualStudio 2019 16.8.2
26 | * .NET 5 SDK 5.0.100
27 |
28 | ## 文档
29 |
30 | 我们在开发的同时也会将我们开发中运用到的一些知识整理成独立的文档。
31 |
32 | * [从零开始创建自定义控件【一】](CustomControl_Lesson_1.md)
33 | * [从零开始创建自定义控件【二】](CustomControl_Lesson_2.md)
34 |
35 | ## 赞助我们
36 |
37 | 
38 | ## 加入项目的开发
39 |
40 | 本项目的开发异常简单,只需要将自己喜欢的布局复用,创建对应的Panel或者Layout即可。
41 |
42 | #### 类型命名约定
43 |
44 | Panel和Layout的命名规则如下:
45 |
46 | > 来源位置+友好的命名+Panel(或者Layout)
47 |
48 | 例如:
49 |
50 | 
51 |
52 | 这是一个推特消息样式,那么类型的命名应该为:
53 |
54 | > TwitterMessagePanel
55 |
56 |
57 |
58 | ## 想要新的样式
59 |
60 | 如果您不想开发,但是又有喜欢的样式,我们这边建议您Fork该项目,并在Documentations的文件夹下加入您想要的布局效果图。
61 |
62 | ### 命名规则约定
63 |
64 | 如果您想要一个布局或者组件,那么请使用下列的命名方式提交到Thumbnails目录:
65 |
66 | Desire_来源网站或者应用_给定一个友好命名_
67 |
68 | ## 控件库
69 |
70 | ### [按钮](Button.md)
71 |
72 | 
73 | 
74 |
75 | 在未来的版本中将会加入一些常用的按钮,这些按钮通过继承的形式实现,不会因为项目中添加了其他的样式类库而产生冲突,而这些按钮相较于`Button` 类型多了以下属性:
76 |
77 | |类型 | 属性 | 属性类型 | 备注 |
78 | |:----------:|:--------------:| :--------:|:---------------------|
79 | | ModeButton | Mode | ButtonMode | 设置按钮模式,共有6种模式|
80 | | PathButton | Icon | Geometry | 设置图标 |
81 | | PathButton | IconWidth | double | 设置图标的宽度 |
82 | | PathButton | IconHeight | double | 设置图标的高度 |
83 | | PathButton | IconPadding | Thickness | 设置图标的内边距 |
84 | | PathButton | IconThickness | double | 设置图标的边缘大小 |
85 | | IconButton | Dock | Dock | 设置图标的停靠位置 |
86 | | ImageButton| Image | ImageSource| 设置图片 |
87 |
88 | #### Roadmap
89 | * 完成的
90 | * ModeButton 用于提供普通文本按钮样式支持
91 | * PathButton 用于提供路径按钮样式支持
92 | * IconButton 用于提供文本图标按钮样式支持
93 | * ImageButton
94 | * 未完成的
95 | * FloatingButton 用于提供圆形浮空按钮样式支持
96 |
97 | #### 为什么要加入按钮
98 |
99 | 因为我们不希望用户困扰,在许多时候混用不同风格的按钮会产生冲突,或者在使用第三方控件的时候发现给定的按钮样式还不能满足您的需求,因此我们抽象了三组按钮每个按钮都提供了六种相同的模式供您选择以备不同场景的使用。这三组按钮不会变更。
100 |
101 | ### 工具面板(ToolbarPanel)
102 | 
103 | 
104 |
105 | ### 呼吁面板(CalloutPanel)
106 |
107 | 
108 |
109 | ### 警告面板(AlertPanel)
110 |
111 | 
112 |
--------------------------------------------------------------------------------
/Build/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##########################################################################
4 | # This is the Cake bootstrapper script for Linux and OS X.
5 | # This file was downloaded from https://github.com/cake-build/resources
6 | # Feel free to change this file to fit your needs.
7 | ##########################################################################
8 |
9 | # Define directories.
10 | SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
11 | TOOLS_DIR=$SCRIPT_DIR/tools
12 | ADDINS_DIR=$TOOLS_DIR/Addins
13 | MODULES_DIR=$TOOLS_DIR/Modules
14 | NUGET_EXE=$TOOLS_DIR/nuget.exe
15 | CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
16 | PACKAGES_CONFIG=$TOOLS_DIR/packages.config
17 | PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
18 | ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config
19 | MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config
20 |
21 | export CAKE_PATHS_TOOLS=$TOOLS_DIR
22 | export CAKE_PATHS_ADDINS=$ADDINS_DIR
23 | export CAKE_PATHS_MODULES=$MODULES_DIR
24 |
25 | # Define md5sum or md5 depending on Linux/OSX
26 | MD5_EXE=
27 | if [[ "$(uname -s)" == "Darwin" ]]; then
28 | MD5_EXE="md5 -r"
29 | else
30 | MD5_EXE="md5sum"
31 | fi
32 |
33 | # Define default arguments.
34 | SCRIPT=$SCRIPT_DIR/build.cake
35 | CAKE_ARGUMENTS=()
36 |
37 | # Parse arguments.
38 | for i in "$@"; do
39 | case $1 in
40 | -s|--script) SCRIPT="$2"; shift ;;
41 | --) shift; CAKE_ARGUMENTS+=("$@"); break ;;
42 | *) CAKE_ARGUMENTS+=("$1") ;;
43 | esac
44 | shift
45 | done
46 |
47 | # Make sure the tools folder exist.
48 | if [ ! -d "$TOOLS_DIR" ]; then
49 | mkdir "$TOOLS_DIR"
50 | fi
51 |
52 | # Make sure that packages.config exist.
53 | if [ ! -f "$TOOLS_DIR/packages.config" ]; then
54 | echo "Downloading packages.config..."
55 | curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages
56 | if [ $? -ne 0 ]; then
57 | echo "An error occurred while downloading packages.config."
58 | exit 1
59 | fi
60 | fi
61 |
62 | # Download NuGet if it does not exist.
63 | if [ ! -f "$NUGET_EXE" ]; then
64 | echo "Downloading NuGet..."
65 | curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
66 | if [ $? -ne 0 ]; then
67 | echo "An error occurred while downloading nuget.exe."
68 | exit 1
69 | fi
70 | fi
71 |
72 | # Restore tools from NuGet.
73 | pushd "$TOOLS_DIR" >/dev/null
74 | if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then
75 | find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf
76 | fi
77 |
78 | mono "$NUGET_EXE" install -ExcludeVersion
79 | if [ $? -ne 0 ]; then
80 | echo "Could not restore NuGet tools."
81 | exit 1
82 | fi
83 |
84 | $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5"
85 |
86 | popd >/dev/null
87 |
88 | # Restore addins from NuGet.
89 | if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then
90 | pushd "$ADDINS_DIR" >/dev/null
91 |
92 | mono "$NUGET_EXE" install -ExcludeVersion
93 | if [ $? -ne 0 ]; then
94 | echo "Could not restore NuGet addins."
95 | exit 1
96 | fi
97 |
98 | popd >/dev/null
99 | fi
100 |
101 | # Restore modules from NuGet.
102 | if [ -f "$MODULES_PACKAGES_CONFIG" ]; then
103 | pushd "$MODULES_DIR" >/dev/null
104 |
105 | mono "$NUGET_EXE" install -ExcludeVersion
106 | if [ $? -ne 0 ]; then
107 | echo "Could not restore NuGet modules."
108 | exit 1
109 | fi
110 |
111 | popd >/dev/null
112 | fi
113 |
114 | # Make sure that Cake has been installed.
115 | if [ ! -f "$CAKE_EXE" ]; then
116 | echo "Could not find Cake.exe at '$CAKE_EXE'."
117 | exit 1
118 | fi
119 |
120 | # Start Cake
121 | exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}"
122 |
--------------------------------------------------------------------------------
/Snippets/textelement.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Expansion
7 |
8 | textelement
9 |
10 |
11 |
12 |
13 |
14 |
15 | textelement
16 |
17 |
18 |
19 |
20 | name
21 | name
22 | name
23 |
24 |
25 |
26 |
27 | (FontFamily)GetValue($name$FontFamilyProperty);
30 | set => SetValue($name$FontFamilyProperty , value);
31 | }
32 |
33 |
34 | public FontStyle $name$FontStyle
35 | {
36 | get => (FontStyle)GetValue($name$FontStyleProperty);
37 | set => SetValue($name$FontStyleProperty , value);
38 | }
39 |
40 |
41 | public FontWeight $name$FontWeight
42 | {
43 | get => (FontWeight)GetValue($name$FontWeightProperty);
44 | set => SetValue($name$FontWeightProperty , value);
45 | }
46 |
47 | public FontStretch $name$FontStretch
48 | {
49 | get => (FontStretch)GetValue($name$FontStretchProperty);
50 | set => SetValue($name$FontStretchProperty , value);
51 | }
52 |
53 |
54 | public double $name$FontSize
55 | {
56 | get => (double)GetValue($name$FontSizeProperty);
57 | set => SetValue($name$FontSizeProperty , value);
58 | }
59 |
60 |
61 | public Brush $name$Foreground
62 | {
63 | get => (Brush)GetValue($name$ForegroundProperty);
64 | set => SetValue($name$ForegroundProperty , value);
65 | }
66 |
67 | public static readonly DependencyProperty $name$ForegroundProperty = DependencyProperty.Register(
68 | "$name$Foreground",
69 | typeof(Brush),
70 | typeof(RibbonSection),
71 | new PropertyMetadata(null));
72 |
73 |
74 | public static readonly DependencyProperty $name$FontSizeProperty = DependencyProperty.Register(
75 | "$name$FontSize",
76 | typeof(double),
77 | typeof(RibbonSection),
78 | new PropertyMetadata(null));
79 |
80 |
81 | public static readonly DependencyProperty $name$FontStretchProperty = DependencyProperty.Register(
82 | "$name$FontStretch",
83 | typeof(FontStretch),
84 | typeof(RibbonSection),
85 | new PropertyMetadata(null));
86 |
87 | public static readonly DependencyProperty $name$FontWeightProperty = DependencyProperty.Register(
88 | "$name$FontWeight",
89 | typeof(FontWeight),
90 | typeof(RibbonSection),
91 | new PropertyMetadata(null));
92 |
93 |
94 | public static readonly DependencyProperty $name$FontStyleProperty = DependencyProperty.Register(
95 | "TitleFontStyle",
96 | typeof($name$FontStyle),
97 | typeof(RibbonSection),
98 | new PropertyMetadata(null));
99 |
100 |
101 | public static readonly DependencyProperty $name$FontFamilyProperty = DependencyProperty.Register(
102 | "$name$FontFamily",
103 | typeof(FontFamily),
104 | typeof(RibbonSection),
105 | new PropertyMetadata(null));]]>
106 |
107 |
108 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Panels/EmptyStatePanel.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
58 |
59 |
--------------------------------------------------------------------------------
/Button.md:
--------------------------------------------------------------------------------
1 | # 按钮
2 |
3 | `Acorisoft.UI` 公开了几组独立的按钮,他通过继承Button的方式来实现,这意味着它独立于其他的第三方样式。它的好处在于你无需担心`Acorisoft.UI`与其他控件样式发生冲突,但坏处也很明显,我们并不能保证所有样式都能够与第三方库进行兼容。
4 |
5 | ## 模式
6 |
7 | 继承于 `ModeButton` 的按钮类型可以通过 `Mode` 属性来设置控件的样式,`Mode` 属性一共包括8个值,每一个值都有独特的效果。
8 |
9 | ### Solid
10 |
11 | 设置为 `Solid` 模式之后,按钮显示背景外观,当鼠标停留在上方时修改背景颜色以及前景颜色。以下是能够修改外观的可用属性:
12 |
13 | 
14 |
15 | | 属性名 | 属性效果 |
16 | |:------------------------:|:----------------------------:|
17 | | Background | 修改默认按钮背景颜色 |
18 | | Foreground | 修改默认按钮前景颜色 |
19 | | HoverBackground | 修改鼠标停留在按钮上时的背景颜色|
20 | | HoverForeground | 修改鼠标停留在按钮上时的前景颜色|
21 | | PressBackground | 修改鼠标按下时的背景颜色 |
22 | | PressForeground | 修改鼠标按下时的前景颜色 |
23 |
24 | ### Opacity
25 |
26 | 设置为`Opacity`透明度模式之后,按钮显示背景外观,当鼠标停留在上方时修改控件透明度,该值为1.0,默认透明度为0.5。这个模式下修改`Background`属性能够修改按钮在鼠标停留时的外观行为。
27 |
28 | 
29 |
30 | | 属性名 | 属性效果 |
31 | |:------------------------:|:----------------------------:|
32 | | Background | 修改默认按钮背景颜色 |
33 | | Foreground | 修改默认按钮前景颜色 |
34 |
35 | ### Outline
36 |
37 | 设置为`Outline`轮廓模式之后,按钮显示边框外观,当鼠标停留在上方时添加背景颜色,以下是能够修改外观的可用属性:
38 |
39 | 
40 |
41 | | 属性名 | 属性效果 |
42 | |:------------------------:|:----------------------------:|
43 | | Background | 修改默认按钮轮廓颜色 |
44 | | Foreground | 修改默认按钮前景颜色 |
45 | | HoverBackground | 修改鼠标停留在按钮上时的背景颜色|
46 | | HoverForeground | 修改鼠标停留在按钮上时的前景颜色|
47 | | PressBackground | 修改鼠标按下时的背景颜色 |
48 | | PressForeground | 修改鼠标按下时的前景颜色 |
49 |
50 | ### CTA
51 | 设置为 `CTA` 模式之后,按钮显示背景外观,当鼠标停留在上方时修改控件透明度,该值为。5,默认透明度为1.0。这个模式下修改`Background`属性能够修改按钮在鼠标停留时的外观行为。
52 |
53 | 
54 |
55 | | 属性名 | 属性效果 |
56 | |:------------------------:|:----------------------------:|
57 | | Background | 修改默认按钮背景颜色 |
58 | | Foreground | 修改默认按钮前景颜色 |
59 |
60 | ### Transparency
61 |
62 | 设置为 `Transparency` 透明模式之后,按钮仅显示文字外观,当鼠标停留在上方时显示背景,以下是能够修改外观的可用属性:
63 |
64 |
65 | 
66 |
67 | | 属性名 | 属性效果 |
68 | |:------------------------:|:----------------------------:|
69 | | Background | 修改默认按钮轮廓颜色 |
70 | | Foreground | 修改默认按钮前景颜色 |
71 | | HoverBackground | 修改鼠标停留在按钮上时的背景颜色|
72 | | HoverForeground | 修改鼠标停留在按钮上时的前景颜色|
73 | | PressBackground | 修改鼠标按下时的背景颜色 |
74 | | PressForeground | 修改鼠标按下时的前景颜色 |
75 |
76 | ### Link
77 |
78 | 设置为 `Link` 透明模式之后,按钮仅显示文字外观,当鼠标停留在上方时修改文本颜色
79 |
80 |
81 | 
82 |
83 | | 属性名 | 属性效果 |
84 | |:------------------------:|:----------------------------:|
85 | | Foreground | 修改默认按钮前景颜色 |
86 | | HoverForeground | 修改鼠标停留在按钮上时的前景颜色|
87 | | PressForeground | 修改鼠标按下时的前景颜色 |
88 |
89 |
90 | ### FadeIn
91 |
92 | 设置为 `FadeIn` 透明模式之后,按钮仅显示文字外观,当鼠标停留在上方时透明度降低
93 |
94 |
95 | 
96 |
97 |
98 | | 属性名 | 属性效果 |
99 | |:------------------------:|:----------------------------:|
100 | | Foreground | 修改默认按钮前景颜色 |
101 |
102 | ### FadeOut
103 |
104 | 设置为 `FadeOut` 透明模式之后,按钮仅显示文字外观,当鼠标停留在上方时显示背景,以下是能够修改外观的可用属性:
105 |
106 |
107 | 
108 |
109 | | 属性名 | 属性效果 |
110 | |:------------------------:|:----------------------------:|
111 | | Foreground | 修改默认按钮前景颜色 |
112 |
113 |
114 | ## 按钮控件一览表
115 |
116 | ### ModeButton
117 |
118 | 模式按钮是`Acorisoft.UI` 按钮家族的基类类型,虽然是基类控件,但是他并不是抽象的,他是可以直接在Xaml中声明使用。
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Utils/DoubleUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | namespace Acorisoft.UI
6 | {
7 | public static class DoubleUtil
8 | {
9 | [StructLayout(LayoutKind.Explicit)]
10 | private struct NanUnion
11 | {
12 | [FieldOffset(0)]
13 | internal double DoubleValue;
14 |
15 | [FieldOffset(0)]
16 | internal ulong UintValue;
17 | }
18 |
19 | internal const double DBL_EPSILON = 2.2204460492503131E-16;
20 |
21 | internal const float FLT_MIN = 1.17549435E-38f;
22 |
23 | public static bool AreClose(double value1 , double value2)
24 | {
25 | if (value1 == value2)
26 | {
27 | return true;
28 | }
29 | double num = (Math.Abs(value1) + Math.Abs(value2) + 10.0) * 2.2204460492503131E-16;
30 | double num2 = value1 - value2;
31 | if (0.0 - num < num2)
32 | {
33 | return num > num2;
34 | }
35 | return false;
36 | }
37 |
38 | public static bool LessThan(double value1 , double value2)
39 | {
40 | if (value1 < value2)
41 | {
42 | return !AreClose(value1 , value2);
43 | }
44 | return false;
45 | }
46 |
47 | public static bool GreaterThan(double value1 , double value2)
48 | {
49 | if (value1 > value2)
50 | {
51 | return !AreClose(value1 , value2);
52 | }
53 | return false;
54 | }
55 |
56 | public static bool LessThanOrClose(double value1 , double value2)
57 | {
58 | if (!(value1 < value2))
59 | {
60 | return AreClose(value1 , value2);
61 | }
62 | return true;
63 | }
64 |
65 | public static bool GreaterThanOrClose(double value1 , double value2)
66 | {
67 | if (!(value1 > value2))
68 | {
69 | return AreClose(value1 , value2);
70 | }
71 | return true;
72 | }
73 |
74 | public static bool IsOne(double value)
75 | {
76 | return Math.Abs(value - 1.0) < 2.2204460492503131E-15;
77 | }
78 |
79 | public static bool IsZero(double value)
80 | {
81 | return Math.Abs(value) < 2.2204460492503131E-15;
82 | }
83 |
84 | public static bool AreClose(Point point1 , Point point2)
85 | {
86 | if (AreClose(point1.X , point2.X))
87 | {
88 | return AreClose(point1.Y , point2.Y);
89 | }
90 | return false;
91 | }
92 |
93 | public static bool AreClose(Size size1 , Size size2)
94 | {
95 | if (AreClose(size1.Width , size2.Width))
96 | {
97 | return AreClose(size1.Height , size2.Height);
98 | }
99 | return false;
100 | }
101 |
102 | public static bool AreClose(Vector vector1 , Vector vector2)
103 | {
104 | if (AreClose(vector1.X , vector2.X))
105 | {
106 | return AreClose(vector1.Y , vector2.Y);
107 | }
108 | return false;
109 | }
110 |
111 | public static bool AreClose(Rect rect1 , Rect rect2)
112 | {
113 | if (rect1.IsEmpty)
114 | {
115 | return rect2.IsEmpty;
116 | }
117 | if (!rect2.IsEmpty && AreClose(rect1.X , rect2.X) && AreClose(rect1.Y , rect2.Y) && AreClose(rect1.Height , rect2.Height))
118 | {
119 | return AreClose(rect1.Width , rect2.Width);
120 | }
121 | return false;
122 | }
123 |
124 | public static bool IsBetweenZeroAndOne(double val)
125 | {
126 | if (GreaterThanOrClose(val , 0.0))
127 | {
128 | return LessThanOrClose(val , 1.0);
129 | }
130 | return false;
131 | }
132 |
133 | public static int DoubleToInt(double val)
134 | {
135 | if (!(0.0 < val))
136 | {
137 | return (int)(val - 0.5);
138 | }
139 | return (int)(val + 0.5);
140 | }
141 |
142 | public static bool RectHasNaN(Rect r)
143 | {
144 | if (IsNaN(r.X) || IsNaN(r.Y) || IsNaN(r.Height) || IsNaN(r.Width))
145 | {
146 | return true;
147 | }
148 | return false;
149 | }
150 |
151 | public static bool IsNaN(double value)
152 | {
153 | NanUnion nanUnion = default(NanUnion);
154 | nanUnion.DoubleValue = value;
155 | ulong num = (ulong)((long)nanUnion.UintValue & -4503599627370496L);
156 | ulong num2 = nanUnion.UintValue & 0xFFFFFFFFFFFFFL;
157 | if (num == 9218868437227405312L || num == 18442240474082181120uL)
158 | {
159 | return num2 != 0;
160 | }
161 | return false;
162 | }
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Buttons/DropDownIconButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Controls.Primitives;
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.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace Acorisoft.UI.Buttons
18 | {
19 | public class DropDownButton : ButtonBase
20 | {
21 |
22 | public object PopupContent
23 | {
24 | get => (object)GetValue(PopupContentProperty);
25 | set => SetValue(PopupContentProperty , value);
26 | }
27 |
28 | public DataTemplate PopupContentTemplate
29 | {
30 | get => (DataTemplate)GetValue(PopupContentTemplateProperty);
31 | set => SetValue(PopupContentTemplateProperty , value);
32 | }
33 |
34 | public DataTemplateSelector PopupContentTemplateSelector
35 | {
36 | get => (DataTemplateSelector)GetValue(PopupContentTemplateSelectorProperty);
37 | set => SetValue(PopupContentTemplateSelectorProperty , value);
38 | }
39 |
40 |
41 | public string PopupContentStringFormat
42 | {
43 | get => (string)GetValue(PopupContentStringFormatProperty);
44 | set => SetValue(PopupContentStringFormatProperty , value);
45 | }
46 |
47 | public static readonly DependencyProperty PopupContentStringFormatProperty = DependencyProperty.Register(
48 | "PopupContentStringFormat",
49 | typeof(string),
50 | typeof(DropDownButton),
51 | new PropertyMetadata(null));
52 |
53 | public static readonly DependencyProperty PopupContentTemplateSelectorProperty = DependencyProperty.Register(
54 | "PopupContentTemplateSelector",
55 | typeof(DataTemplateSelector),
56 | typeof(DropDownButton),
57 | new PropertyMetadata(null));
58 |
59 | public static readonly DependencyProperty PopupContentTemplateProperty = DependencyProperty.Register(
60 | "PopupContentTemplate",
61 | typeof(DataTemplate),
62 | typeof(DropDownButton),
63 | new PropertyMetadata(null));
64 |
65 | public static readonly DependencyProperty PopupContentProperty = DependencyProperty.Register(
66 | "PopupContent",
67 | typeof(object),
68 | typeof(DropDownButton),
69 | new PropertyMetadata(null));
70 | }
71 |
72 | public class DropDownIconButton : DropDownButton
73 | {
74 | static DropDownIconButton()
75 | {
76 | DefaultStyleKeyProperty.OverrideMetadata(typeof(DropDownIconButton) , new FrameworkPropertyMetadata(typeof(DropDownIconButton)));
77 | }
78 |
79 | public double IconWidth
80 | {
81 | get => (double)GetValue(IconWidthProperty);
82 | set => SetValue(IconWidthProperty , value);
83 | }
84 |
85 | public double IconHeight
86 | {
87 | get => (double)GetValue(IconHeightProperty);
88 | set => SetValue(IconHeightProperty , value);
89 | }
90 |
91 | public Thickness IconPadding
92 | {
93 | get => (Thickness)GetValue(IconPaddingProperty);
94 | set => SetValue(IconPaddingProperty , value);
95 | }
96 |
97 |
98 | public Geometry Icon
99 | {
100 | get => (Geometry)GetValue(IconProperty);
101 | set => SetValue(IconProperty , value);
102 | }
103 |
104 |
105 |
106 | public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
107 | "Icon",
108 | typeof(Geometry),
109 | typeof(DropDownIconButton),
110 | new PropertyMetadata(null));
111 |
112 | public static readonly DependencyProperty IconPaddingProperty = DependencyProperty.Register(
113 | "IconPadding",
114 | typeof(Thickness),
115 | typeof(DropDownIconButton),
116 | new PropertyMetadata(null));
117 |
118 | public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register(
119 | "IconHeight",
120 | typeof(double),
121 | typeof(DropDownIconButton),
122 | new PropertyMetadata(null));
123 |
124 | public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(
125 | "IconWidth",
126 | typeof(double),
127 | typeof(DropDownIconButton),
128 | new PropertyMetadata(null));
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Buttons/CloseButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
76 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Buttons/ToggleStateButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
75 |
76 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Controls/BulletControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace Acorisoft.UI.Controls
10 | {
11 | public enum BulletMode
12 | {
13 | Fixed,
14 | Auto
15 | }
16 |
17 | public class BulletControl : ContentControl
18 | {
19 | static BulletControl()
20 | {
21 | DefaultStyleKeyProperty.OverrideMetadata(typeof(BulletControl) , new FrameworkPropertyMetadata(typeof(BulletControl)));
22 | }
23 |
24 | public double BulletSize
25 | {
26 | get => (double)GetValue(BulletSizeProperty);
27 | set => SetValue(BulletSizeProperty , value);
28 | }
29 |
30 | public BulletMode Mode
31 | {
32 | get => (BulletMode)GetValue(ModeProperty);
33 | set => SetValue(ModeProperty , value);
34 | }
35 |
36 | public object Bullet
37 | {
38 | get => (object)GetValue(BulletProperty);
39 | set => SetValue(BulletProperty , value);
40 | }
41 |
42 | public DataTemplate BulletTemplate
43 | {
44 | get => (DataTemplate)GetValue(BulletTemplateProperty);
45 | set => SetValue(BulletTemplateProperty , value);
46 | }
47 |
48 | public DataTemplateSelector BulletTemplateSelector
49 | {
50 | get => (DataTemplateSelector)GetValue(BulletTemplateSelectorProperty);
51 | set => SetValue(BulletTemplateSelectorProperty , value);
52 | }
53 |
54 |
55 | public string BulletStringFormat
56 | {
57 | get => (string)GetValue(BulletStringFormatProperty);
58 | set => SetValue(BulletStringFormatProperty , value);
59 | }
60 |
61 | public Thickness BulletPadding
62 | {
63 | get => (Thickness)GetValue(BulletPaddingProperty);
64 | set => SetValue(BulletPaddingProperty , value);
65 | }
66 |
67 |
68 | public HorizontalAlignment HorizontalBulletAlignment
69 | {
70 | get => (HorizontalAlignment)GetValue(HorizontalBulletAlignmentProperty);
71 | set => SetValue(HorizontalBulletAlignmentProperty , value);
72 | }
73 |
74 |
75 | public VerticalAlignment VerticalBulletAlignment
76 | {
77 | get => (VerticalAlignment)GetValue(VerticalBulletAlignmentProperty);
78 | set => SetValue(VerticalBulletAlignmentProperty , value);
79 | }
80 |
81 | public static readonly DependencyProperty HorizontalBulletAlignmentProperty = DependencyProperty.Register(
82 | "HorizontalBulletAlignment",
83 | typeof(HorizontalAlignment),
84 | typeof(BulletControl),
85 | new PropertyMetadata(null));
86 |
87 | public static readonly DependencyProperty VerticalBulletAlignmentProperty = DependencyProperty.Register(
88 | "VerticalBulletAlignment",
89 | typeof(VerticalAlignment),
90 | typeof(BulletControl),
91 | new PropertyMetadata(null));
92 |
93 | public static readonly DependencyProperty BulletPaddingProperty = DependencyProperty.Register(
94 | "BulletPadding",
95 | typeof(Thickness),
96 | typeof(BulletControl),
97 | new PropertyMetadata(null));
98 |
99 | public static readonly DependencyProperty BulletStringFormatProperty = DependencyProperty.Register(
100 | "BulletStringFormat",
101 | typeof(string),
102 | typeof(BulletControl),
103 | new PropertyMetadata(null));
104 |
105 | public static readonly DependencyProperty BulletTemplateSelectorProperty = DependencyProperty.Register(
106 | "BulletTemplateSelector",
107 | typeof(DataTemplateSelector),
108 | typeof(BulletControl),
109 | new PropertyMetadata(null));
110 |
111 | public static readonly DependencyProperty BulletTemplateProperty = DependencyProperty.Register(
112 | "BulletTemplate",
113 | typeof(DataTemplate),
114 | typeof(BulletControl),
115 | new PropertyMetadata(null));
116 |
117 | public static readonly DependencyProperty BulletProperty = DependencyProperty.Register(
118 | "Bullet",
119 | typeof(object),
120 | typeof(BulletControl),
121 | new PropertyMetadata(null));
122 | public static readonly DependencyProperty ModeProperty = DependencyProperty.Register(
123 | "Mode",
124 | typeof(BulletMode),
125 | typeof(BulletControl),
126 | new PropertyMetadata(null));
127 |
128 | public static readonly DependencyProperty BulletSizeProperty = DependencyProperty.Register(
129 | "BulletSize",
130 | typeof(double),
131 | typeof(BulletControl),
132 | new PropertyMetadata(null));
133 |
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Windows/ColorWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
84 |
85 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Panels/AlertPanel.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
74 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Panels/CalloutPanel.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
88 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Windows/ColorWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 |
12 | namespace Acorisoft.UI.Windows
13 | {
14 | public class ColorWindow : Window
15 | {
16 | static ColorWindow()
17 | {
18 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorWindow) , new FrameworkPropertyMetadata(typeof(ColorWindow)));
19 | }
20 |
21 |
22 | public ColorWindow()
23 | {
24 | CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand , CloseWindow));
25 | CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand , MaximizeWindow , CanResizeWindow));
26 | CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand , MinimizeWindow , CanMinimizeWindow));
27 | CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand , RestoreWindow , CanResizeWindow));
28 | }
29 |
30 |
31 | #region Window Commands
32 |
33 | private void CanResizeWindow(object sender , CanExecuteRoutedEventArgs e)
34 | {
35 | e.CanExecute = ResizeMode == ResizeMode.CanResize || ResizeMode == ResizeMode.CanResizeWithGrip;
36 | }
37 |
38 | private void CanMinimizeWindow(object sender , CanExecuteRoutedEventArgs e)
39 | {
40 | e.CanExecute = ResizeMode != ResizeMode.NoResize;
41 | }
42 |
43 | private void CloseWindow(object sender , ExecutedRoutedEventArgs e)
44 | {
45 | this.Close();
46 | }
47 |
48 | private void MaximizeWindow(object sender , ExecutedRoutedEventArgs e)
49 | {
50 | if (WindowState == WindowState.Maximized)
51 | {
52 | SystemCommands.RestoreWindow(this);
53 | }
54 | else
55 | {
56 | SystemCommands.MaximizeWindow(this);
57 | }
58 | }
59 |
60 | private void MinimizeWindow(object sender , ExecutedRoutedEventArgs e)
61 | {
62 | SystemCommands.MinimizeWindow(this);
63 | }
64 |
65 | private void RestoreWindow(object sender , ExecutedRoutedEventArgs e)
66 | {
67 | SystemCommands.RestoreWindow(this);
68 | }
69 |
70 |
71 | private void ShowSystemMenu(object sender , ExecutedRoutedEventArgs e)
72 | {
73 | FrameworkElement element = e.OriginalSource as FrameworkElement;
74 | if (element == null)
75 | return;
76 |
77 | var point = WindowState == WindowState.Maximized ? new Point(0, element.ActualHeight)
78 | : new Point(Left + BorderThickness.Left, element.ActualHeight + Top + BorderThickness.Top);
79 | point = element.TransformToAncestor(this).Transform(point);
80 | SystemCommands.ShowSystemMenu(this , point);
81 | }
82 |
83 |
84 | #endregion Window Commands
85 |
86 | public object TitleBar
87 | {
88 | get => (object)GetValue(TitleBarProperty);
89 | set => SetValue(TitleBarProperty , value);
90 | }
91 |
92 | public DataTemplate TitleBarTemplate
93 | {
94 | get => (DataTemplate)GetValue(TitleBarTemplateProperty);
95 | set => SetValue(TitleBarTemplateProperty , value);
96 | }
97 |
98 | public DataTemplateSelector TitleBarTemplateSelector
99 | {
100 | get => (DataTemplateSelector)GetValue(TitleBarTemplateSelectorProperty);
101 | set => SetValue(TitleBarTemplateSelectorProperty , value);
102 | }
103 |
104 |
105 | public string TitleBarStringFormat
106 | {
107 | get => (string)GetValue(TitleBarStringFormatProperty);
108 | set => SetValue(TitleBarStringFormatProperty , value);
109 | }
110 |
111 | public Brush Color
112 | {
113 | get => (Brush)GetValue(ColorProperty);
114 | set => SetValue(ColorProperty , value);
115 | }
116 |
117 |
118 | public Thickness TitleBarPadding
119 | {
120 | get => (Thickness)GetValue(TitleBarPaddingProperty);
121 | set => SetValue(TitleBarPaddingProperty , value);
122 | }
123 |
124 | public static readonly DependencyProperty TitleBarPaddingProperty = DependencyProperty.Register(
125 | "TitleBarPadding",
126 | typeof(Thickness),
127 | typeof(ColorWindow),
128 | new PropertyMetadata(null));
129 |
130 | public static readonly DependencyProperty TitleBarStringFormatProperty = DependencyProperty.Register(
131 | "TitleBarStringFormat",
132 | typeof(string),
133 | typeof(ColorWindow),
134 | new PropertyMetadata(null));
135 |
136 | public static readonly DependencyProperty TitleBarTemplateSelectorProperty = DependencyProperty.Register(
137 | "TitleBarTemplateSelector",
138 | typeof(DataTemplateSelector),
139 | typeof(ColorWindow),
140 | new PropertyMetadata(null));
141 |
142 | public static readonly DependencyProperty TitleBarTemplateProperty = DependencyProperty.Register(
143 | "TitleBarTemplate",
144 | typeof(DataTemplate),
145 | typeof(ColorWindow),
146 | new PropertyMetadata(null));
147 |
148 | public static readonly DependencyProperty TitleBarProperty = DependencyProperty.Register(
149 | "TitleBar",
150 | typeof(object),
151 | typeof(ColorWindow),
152 | new PropertyMetadata(null));
153 |
154 | public static readonly DependencyProperty ColorProperty = DependencyProperty.Register(
155 | "Color",
156 | typeof(Brush),
157 | typeof(ColorWindow),
158 | new PropertyMetadata(null));
159 |
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/CustomControl_Lesson_1.md:
--------------------------------------------------------------------------------
1 |
2 | # 从零开始创建自定义控件【一】
3 |
4 | 这个课程是面向的是Wpf新手,那些想要学习如何自定义控件的同学。
5 |
6 | ## 第一步
7 |
8 | 打开Visual Studio,并且新建一个WPF Custom Control Library的项目。
9 | 
10 |
11 | 这时候我们可以看到默认的自定义控件库项目包括以下几个元素:
12 |
13 | 
14 |
15 | * CustomControl1.cs
16 | * Themes\Generic.xaml
17 | * AssemblyInfo.cs
18 |
19 | 下面我来讲解一下这几个文件的主要意义。
20 |
21 | ### AssemblyInfo.cs
22 |
23 | 这个文件主要包含了生成程序集信息的特性,它里面的内容主要有:
24 |
25 | 
26 |
27 | ```C#
28 |
29 | using System.Windows;
30 |
31 | [assembly: ThemeInfo(
32 | ResourceDictionaryLocation.None , //where theme specific resource dictionaries are located
33 | //(used if a resource is not found in the page,
34 | // or application resource dictionaries)
35 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
36 | //(used if a resource is not found in the page,
37 | // app, or any theme specific resource dictionaries)
38 | )]
39 |
40 |
41 | ```
42 |
43 | 我们再来看一下`Acorisoft.UI` 中的AssemblyInfo.cs内容
44 |
45 | ``` C#
46 | using System.Windows;
47 | using System.Windows.Markup;
48 |
49 | [assembly: ThemeInfo(ResourceDictionaryLocation.None , ResourceDictionaryLocation.SourceAssembly)]
50 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Buttons")]
51 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Controls")]
52 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Panels")]
53 | [assembly: XmlnsDefinition("https://github.com/Acorisoft/UI" , "Acorisoft.UI.Windows")]
54 |
55 | ```
56 |
57 | 可以看到`Acorisoft.UI`的内容比自定义多出了一点。那么我们来解释一下这些内容的含义:
58 |
59 | `ThemeInfo` 用来指示样式外观的,这个特性暂且不解释,详细请看[深入WPF--Style](https://www.cnblogs.com/Zhouyongh/archive/2011/08/01/2123610.html)
60 |
61 | `XmlnsDefinition` 用于将一个CLR命名空间映射到一个XML命名空间。内容不是很多,如果想看更详细的知识请参阅[剖析 AssemblyInfo.cs - 了解常用的特性 Attribute](https://www.cnblogs.com/liqingwen/p/5944391.html)
62 |
63 |
64 | ### CustomControl1.cs
65 |
66 | 在创建自定义控件项目的同时,系统也会帮你自动创建一个自定义控件,这个控件即CustomControl1。我们打开CustomControl1.cs即可看到里面的内容:
67 |
68 | ``` C#
69 | using System;
70 | using System.Collections.Generic;
71 | using System.Linq;
72 | using System.Text;
73 | using System.Threading.Tasks;
74 | using System.Windows;
75 | using System.Windows.Controls;
76 | using System.Windows.Data;
77 | using System.Windows.Documents;
78 | using System.Windows.Input;
79 | using System.Windows.Media;
80 | using System.Windows.Media.Imaging;
81 | using System.Windows.Navigation;
82 | using System.Windows.Shapes;
83 |
84 | namespace Acorisoft.UI.Lesson
85 | {
86 | ///
87 | /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
88 | ///
89 | /// Step 1a) Using this custom control in a XAML file that exists in the current project.
90 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
91 | /// to be used:
92 | ///
93 | /// xmlns:MyNamespace="clr-namespace:Acorisoft.UI.Lesson"
94 | ///
95 | ///
96 | /// Step 1b) Using this custom control in a XAML file that exists in a different project.
97 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
98 | /// to be used:
99 | ///
100 | /// xmlns:MyNamespace="clr-namespace:Acorisoft.UI.Lesson;assembly=Acorisoft.UI.Lesson"
101 | ///
102 | /// You will also need to add a project reference from the project where the XAML file lives
103 | /// to this project and Rebuild to avoid compilation errors:
104 | ///
105 | /// Right click on the target project in the Solution Explorer and
106 | /// "Add Reference"->"Projects"->[Select this project]
107 | ///
108 | ///
109 | /// Step 2)
110 | /// Go ahead and use your control in the XAML file.
111 | ///
112 | ///
113 | ///
114 | ///
115 | public class CustomControl1 : Control
116 | {
117 | static CustomControl1()
118 | {
119 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1) , new FrameworkPropertyMetadata(typeof(CustomControl1)));
120 | }
121 | }
122 | }
123 |
124 |
125 | ```
126 | 实际上我们把它精简一下,即得到以下内容:
127 | ``` C#
128 | namespace $Namespace$
129 | {
130 | public class CustomControl1 : Control
131 | {
132 | static CustomControl1()
133 | {
134 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1) , new FrameworkPropertyMetadata(typeof(CustomControl1)));
135 | }
136 | }
137 | }
138 |
139 | ```
140 |
141 | 控件首先会添加一个静态构造函数,用于重写默认样式的元数据,重写元数据之后它会在themes/generic.xaml的文件获取默认的样式。
142 |
143 | ## Generic.xaml
144 |
145 | `Generic.xaml` 用于放置自定义控件的默认样式,样式以Style元素定义,通过`TargetType`来指定该样式是哪个控件的默认样式。
146 |
147 | ``` XAML
148 |
152 |
164 |
165 |
166 | ```
167 | ## 引用
168 | * [深入WPF--Style](https://www.cnblogs.com/Zhouyongh/archive/2011/08/01/2123610.html)
169 | * [WPF 依赖项属性的AddOwner与OverrideMetadata区别](https://huchengv5.github.io/post/WPF-%E4%BE%9D%E8%B5%96%E9%A1%B9%E5%B1%9E%E6%80%A7%E7%9A%84AddOwner%E4%B8%8EOverrideMetadata%E5%8C%BA%E5%88%AB.html)
170 | * [剖析 AssemblyInfo.cs - 了解常用的特性 Attribute](https://www.cnblogs.com/liqingwen/p/5944391.html)
171 |
172 | [下一篇](CustomControl_Lesson_2.md)
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Colors/MaterialDesignColors.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 | #F44336
5 | #D32F2F
6 | #E91E63
7 | #C2185B
8 | #9C27B0
9 | #7B1FA2
10 | #673AB7
11 | #512DA8
12 | #3F51B5
13 | #303F9F
14 | #2196F3
15 | #1976D2
16 | #03A9F4
17 | #0288D1
18 | #00BCD4
19 | #0097A7
20 | #009688
21 | #00796B
22 | #4CAF50
23 | #388E3C
24 | #8BC34A
25 | #689F38
26 | #CDDC39
27 | #AFB42B
28 | #FFEB3B
29 | #FBC02D
30 | #FFC107
31 | #FFA000
32 | #FF9800
33 | #F57C00
34 | #FF5722
35 | #E64A19
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Controls/BannerMessageDialogControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Acorisoft.UI.Controls
17 | {
18 | ///
19 | ///
20 | ///
21 | public class BannerMessageDialogControl : ContentControl
22 | {
23 | static BannerMessageDialogControl()
24 | {
25 | DefaultStyleKeyProperty.OverrideMetadata(typeof(BannerMessageDialogControl) , new FrameworkPropertyMetadata(typeof(BannerMessageDialogControl)));
26 | }
27 |
28 |
29 | public CornerRadius CornerRadius
30 | {
31 | get => (CornerRadius)GetValue(CornerRadiusProperty);
32 | set => SetValue(CornerRadiusProperty , value);
33 | }
34 |
35 |
36 | public ImageSource Banner
37 | {
38 | get => (ImageSource)GetValue(BannerProperty);
39 | set => SetValue(BannerProperty , value);
40 | }
41 |
42 | public object Title
43 | {
44 | get => (object)GetValue(TitleProperty);
45 | set => SetValue(TitleProperty , value);
46 | }
47 |
48 | public DataTemplate TitleTemplate
49 | {
50 | get => (DataTemplate)GetValue(TitleTemplateProperty);
51 | set => SetValue(TitleTemplateProperty , value);
52 | }
53 |
54 | public DataTemplateSelector TitleTemplateSelector
55 | {
56 | get => (DataTemplateSelector)GetValue(TitleTemplateSelectorProperty);
57 | set => SetValue(TitleTemplateSelectorProperty , value);
58 | }
59 |
60 |
61 | public string TitleStringFormat
62 | {
63 | get => (string)GetValue(TitleStringFormatProperty);
64 | set => SetValue(TitleStringFormatProperty , value);
65 | }
66 |
67 |
68 | public object DefaultButtonContent
69 | {
70 | get => (object)GetValue(DefaultButtonContentProperty);
71 | set => SetValue(DefaultButtonContentProperty , value);
72 | }
73 |
74 | public DataTemplate DefaultButtonContentTemplate
75 | {
76 | get => (DataTemplate)GetValue(DefaultButtonContentTemplateProperty);
77 | set => SetValue(DefaultButtonContentTemplateProperty , value);
78 | }
79 |
80 | public DataTemplateSelector DefaultButtonContentTemplateSelector
81 | {
82 | get => (DataTemplateSelector)GetValue(DefaultButtonContentTemplateSelectorProperty);
83 | set => SetValue(DefaultButtonContentTemplateSelectorProperty , value);
84 | }
85 |
86 |
87 | public string DefaultButtonContentStringFormat
88 | {
89 | get => (string)GetValue(DefaultButtonContentStringFormatProperty);
90 | set => SetValue(DefaultButtonContentStringFormatProperty , value);
91 | }
92 |
93 |
94 | public ICommand Command
95 | {
96 | get => (ICommand)GetValue(CommandProperty);
97 | set => SetValue(CommandProperty , value);
98 | }
99 |
100 | public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
101 | "Command",
102 | typeof(ICommand),
103 | typeof(BannerMessageDialogControl),
104 | new PropertyMetadata(null));
105 |
106 |
107 | public static readonly DependencyProperty DefaultButtonContentStringFormatProperty = DependencyProperty.Register(
108 | "DefaultButtonContentStringFormat",
109 | typeof(string),
110 | typeof(BannerMessageDialogControl),
111 | new PropertyMetadata(null));
112 |
113 | public static readonly DependencyProperty DefaultButtonContentTemplateSelectorProperty = DependencyProperty.Register(
114 | "DefaultButtonContentTemplateSelector",
115 | typeof(DataTemplateSelector),
116 | typeof(BannerMessageDialogControl),
117 | new PropertyMetadata(null));
118 |
119 | public static readonly DependencyProperty DefaultButtonContentTemplateProperty = DependencyProperty.Register(
120 | "DefaultButtonContentTemplate",
121 | typeof(DataTemplate),
122 | typeof(BannerMessageDialogControl),
123 | new PropertyMetadata(null));
124 |
125 | public static readonly DependencyProperty DefaultButtonContentProperty = DependencyProperty.Register(
126 | "DefaultButtonContent",
127 | typeof(object),
128 | typeof(BannerMessageDialogControl),
129 | new PropertyMetadata(null));
130 |
131 | public static readonly DependencyProperty TitleStringFormatProperty = DependencyProperty.Register(
132 | "TitleStringFormat",
133 | typeof(string),
134 | typeof(BannerMessageDialogControl),
135 | new PropertyMetadata(null));
136 |
137 | public static readonly DependencyProperty TitleTemplateSelectorProperty = DependencyProperty.Register(
138 | "TitleTemplateSelector",
139 | typeof(DataTemplateSelector),
140 | typeof(BannerMessageDialogControl),
141 | new PropertyMetadata(null));
142 |
143 | public static readonly DependencyProperty TitleTemplateProperty = DependencyProperty.Register(
144 | "TitleTemplate",
145 | typeof(DataTemplate),
146 | typeof(BannerMessageDialogControl),
147 | new PropertyMetadata(null));
148 |
149 | public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
150 | "Title",
151 | typeof(object),
152 | typeof(BannerMessageDialogControl),
153 | new PropertyMetadata(null));
154 | public static readonly DependencyProperty BannerProperty = DependencyProperty.Register(
155 | "Banner",
156 | typeof(ImageSource),
157 | typeof(BannerMessageDialogControl),
158 | new PropertyMetadata(null));
159 |
160 |
161 | public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(
162 | "CornerRadius",
163 | typeof(CornerRadius),
164 | typeof(BannerMessageDialogControl),
165 | new PropertyMetadata(null));
166 |
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Controls/BannerMessageDialogControl.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
103 |
104 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI.Host/Views/PanelDemoCtl.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
13 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
69 |
70 |
72 |
75 |
78 |
79 |
80 |
81 |
82 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
95 |
96 |
101 |
102 |
104 |
106 |
107 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/src/Acorisoft.UI/Themes/Panels/ToolbarPanel.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
112 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 | [Pp]ublishes
30 |
31 | # Visual Studio 2015/2017 cache/options directory
32 | .vs/
33 | # Uncomment if you have tasks that create the project's static files in wwwroot
34 | #wwwroot/
35 |
36 | # Visual Studio 2017 auto generated files
37 | Generated\ Files/
38 |
39 | # MSTest test Results
40 | [Tt]est[Rr]esult*/
41 | [Bb]uild[Ll]og.*
42 |
43 | # NUNIT
44 | *.VisualState.xml
45 | TestResult.xml
46 |
47 | # Build Results of an ATL Project
48 | [Dd]ebugPS/
49 | [Rr]eleasePS/
50 | dlldata.c
51 |
52 | # Benchmark Results
53 | BenchmarkDotNet.Artifacts/
54 |
55 | # .NET Core
56 | project.lock.json
57 | project.fragment.lock.json
58 | artifacts/
59 |
60 | # StyleCop
61 | StyleCopReport.xml
62 |
63 | # Files built by Visual Studio
64 | *_i.c
65 | *_p.c
66 | *_h.h
67 | *.ilk
68 | *.meta
69 | *.obj
70 | *.iobj
71 | *.pch
72 | *.pdb
73 | *.ipdb
74 | *.pgc
75 | *.pgd
76 | *.rsp
77 | *.sbr
78 | *.tlb
79 | *.tli
80 | *.7z
81 | *.tlh
82 | *.tmp
83 | *.tmp_proj
84 | *_wpftmp.csproj
85 | *.log
86 | *.vspscc
87 | *.vssscc
88 | .builds
89 | *.pidb
90 | *.svclog
91 | *.scc
92 |
93 | # Chutzpah Test files
94 | _Chutzpah*
95 |
96 | # Visual C++ cache files
97 | ipch/
98 | *.aps
99 | *.ncb
100 | *.opendb
101 | *.opensdf
102 | *.sdf
103 | *.cachefile
104 | *.VC.db
105 | *.VC.VC.opendb
106 |
107 | # Visual Studio profiler
108 | *.psess
109 | *.vsp
110 | *.vspx
111 | *.sap
112 |
113 | # Visual Studio Trace Files
114 | *.e2e
115 |
116 | # TFS 2012 Local Workspace
117 | $tf/
118 |
119 | # Guidance Automation Toolkit
120 | *.gpState
121 |
122 | # ReSharper is a .NET coding add-in
123 | _ReSharper*/
124 | *.[Rr]e[Ss]harper
125 | *.DotSettings.user
126 |
127 | # JustCode is a .NET coding add-in
128 | .JustCode
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # The packages folder can be ignored because of Package Restore
188 | **/[Pp]ackages/*
189 | # except build/, which is used as an MSBuild target.
190 | !**/[Pp]ackages/build/
191 | # Uncomment if necessary however generally it will be regenerated when needed
192 | #!**/[Pp]ackages/repositories.config
193 | # NuGet v3's project.json files produces more ignorable files
194 | *.nuget.props
195 | *.nuget.targets
196 |
197 | # Microsoft Azure Build Output
198 | csx/
199 | *.build.csdef
200 |
201 | # Microsoft Azure Emulator
202 | ecf/
203 | rcf/
204 |
205 | # Windows Store app package directories and files
206 | AppPackages/
207 | BundleArtifacts/
208 | Package.StoreAssociation.xml
209 | _pkginfo.txt
210 | *.appx
211 |
212 | # Visual Studio cache files
213 | # files ending in .cache can be ignored
214 | *.[Cc]ache
215 | # but keep track of directories ending in .cache
216 | !?*.[Cc]ache/
217 |
218 | # Others
219 | ClientBin/
220 | ~$*
221 | *~
222 | *.dbmdl
223 | *.dbproj.schemaview
224 | *.jfm
225 | *.pfx
226 | *.publishsettings
227 | orleans.codegen.cs
228 |
229 | # Including strong name files can present a security risk
230 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
231 | #*.snk
232 |
233 | # Since there are multiple workflows, uncomment next line to ignore bower_components
234 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
235 | #bower_components/
236 |
237 | # RIA/Silverlight projects
238 | Generated_Code/
239 |
240 | # Backup & report files from converting an old project file
241 | # to a newer Visual Studio version. Backup files are not needed,
242 | # because we have git ;-)
243 | _UpgradeReport_Files/
244 | Backup*/
245 | UpgradeLog*.XML
246 | UpgradeLog*.htm
247 | ServiceFabricBackup/
248 | *.rptproj.bak
249 |
250 | # SQL Server files
251 | *.mdf
252 | *.ldf
253 | *.ndf
254 |
255 | # Business Intelligence projects
256 | *.rdl.data
257 | *.bim.layout
258 | *.bim_*.settings
259 | *.rptproj.rsuser
260 | *- Backup*.rdl
261 |
262 | # Microsoft Fakes
263 | FakesAssemblies/
264 |
265 | # GhostDoc plugin setting file
266 | *.GhostDoc.xml
267 |
268 | # Node.js Tools for Visual Studio
269 | .ntvs_analysis.dat
270 | node_modules/
271 |
272 | # Visual Studio 6 build log
273 | *.plg
274 |
275 | # Visual Studio 6 workspace options file
276 | *.opt
277 |
278 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
279 | *.vbw
280 |
281 | # Visual Studio LightSwitch build output
282 | **/*.HTMLClient/GeneratedArtifacts
283 | **/*.DesktopClient/GeneratedArtifacts
284 | **/*.DesktopClient/ModelManifest.xml
285 | **/*.Server/GeneratedArtifacts
286 | **/*.Server/ModelManifest.xml
287 | _Pvt_Extensions
288 |
289 | # Paket dependency manager
290 | .paket/paket.exe
291 | paket-files/
292 |
293 | # FAKE - F# Make
294 | .fake/
295 |
296 | # JetBrains Rider
297 | .idea/
298 | *.sln.iml
299 |
300 | # CodeRush personal settings
301 | .cr/personal
302 |
303 | # Python Tools for Visual Studio (PTVS)
304 | __pycache__/
305 | *.pyc
306 |
307 | # Cake - Uncomment if you are using it
308 | # tools/**
309 | # !tools/packages.config
310 |
311 | # Tabs Studio
312 | *.tss
313 |
314 | # Telerik's JustMock configuration file
315 | *.jmconfig
316 |
317 | # BizTalk build output
318 | *.btp.cs
319 | *.btm.cs
320 | *.odx.cs
321 | *.xsd.cs
322 |
323 | # OpenCover UI analysis results
324 | OpenCover/
325 |
326 | # Azure Stream Analytics local run output
327 | ASALocalRun/
328 |
329 | # MSBuild Binary and Structured Log
330 | *.binlog
331 |
332 | # NVidia Nsight GPU debugger configuration file
333 | *.nvuser
334 |
335 | # MFractors (Xamarin productivity tool) working folder
336 | .mfractor/
337 |
338 | # Local History for Visual Studio
339 | .localhistory/
340 |
341 | # BeatPulse healthcheck temp database
342 | healthchecksdb
343 | /src/Wpf/Acorisoft.Component.Wpf/BindingProxyGeneric.cs
344 | /src/Wpf/Acorisoft.Component.Wpf/BindingProxy.cs
345 |
--------------------------------------------------------------------------------