├── .editorconfig ├── .gitattributes ├── .gitignore ├── MyWPF.sln ├── README.md ├── WPFTemplate ├── App.config ├── Command │ ├── CommandBase.cs │ └── CommandCenter.cs ├── Controls │ ├── Chart │ │ ├── Bar.cs │ │ ├── BarItem.cs │ │ ├── Chart.cs │ │ ├── ChartItem.cs │ │ ├── CurveChart.cs │ │ ├── Donut.cs │ │ ├── LineChart.cs │ │ └── StepChart.cs │ ├── Extra │ │ ├── Badge.cs │ │ ├── Card.cs │ │ ├── Carousel.cs │ │ ├── ColorSlider.xaml │ │ ├── ColorSlider.xaml.cs │ │ ├── CornerMultiComboBox.cs │ │ ├── CornerMultiComboBoxItem.cs │ │ ├── CornerPagination.cs │ │ ├── Drawer.cs │ │ ├── DrawerItem.cs │ │ ├── Loading.cs │ │ ├── NoticeBar.cs │ │ ├── NotifyWindow.xaml │ │ ├── NotifyWindow.xaml.cs │ │ ├── PlaceControl.cs │ │ ├── Steps.cs │ │ ├── StepsItem.cs │ │ ├── Toast.cs │ │ ├── ToastWindow.xaml │ │ └── ToastWindow.xaml.cs │ └── Original │ │ ├── CornerButton.cs │ │ ├── CornerCalendar.cs │ │ ├── CornerCheckBox.cs │ │ ├── CornerCombobox.cs │ │ ├── CornerContextMenu.cs │ │ ├── CornerDatePicker.cs │ │ ├── CornerExpander.cs │ │ ├── CornerMenu.cs │ │ ├── CornerMenuItem.cs │ │ ├── CornerPasswordBox.xaml │ │ ├── CornerPasswordBox.xaml.cs │ │ ├── CornerProgressBar.cs │ │ ├── CornerRadioButton.cs │ │ ├── CornerSlider.cs │ │ ├── CornerTabControl.cs │ │ ├── CornerTabItem.cs │ │ ├── CornerTextBox.cs │ │ ├── CornerToolTip.cs │ │ └── CornerTreeView.cs ├── Enums │ ├── ButtonEnum.cs │ ├── CardType.cs │ ├── CheckBoxEnum.cs │ ├── NotifySourceEnum.cs │ ├── PlaceControlEnum.cs │ ├── ProgressBarEnum.cs │ ├── RadioButtonEnums.cs │ ├── SliderEnum.cs │ ├── TabControlEnum.cs │ ├── TextBoxEnum.cs │ └── TreeViewEnum.cs ├── Images │ └── test.png ├── MainWindow.xaml.cs ├── NotifyPropertyChangedBase.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── Converters.xaml │ ├── Microsoft.Expression.Drawing.dll │ └── iconfont.ttf ├── Test │ └── Models.cs ├── Themes │ ├── Chart │ │ ├── BarItem.xaml │ │ ├── Chart.xaml │ │ ├── ChartItem.xaml │ │ └── Donut.xaml │ ├── Extra │ │ ├── Card.xaml │ │ ├── Carousel.xaml │ │ ├── CornerPagination.xaml │ │ ├── Drawer.xaml │ │ ├── DrawerItem.xaml │ │ ├── Loading.xaml │ │ ├── NoticeBar.xaml │ │ ├── PlaceControl.xaml │ │ ├── Steps.xaml │ │ └── StepsItem.xaml │ ├── Generic.xaml │ └── Original │ │ ├── CornerButton.xaml │ │ ├── CornerCalendar.xaml │ │ ├── CornerCheckBox.xaml │ │ ├── CornerComboBox.xaml │ │ ├── CornerContextMenu.xaml │ │ ├── CornerDatePicker.xaml │ │ ├── CornerExpander.xaml │ │ ├── CornerMenu.xaml │ │ ├── CornerMenuItem.xaml │ │ ├── CornerMultiComboBox.xaml │ │ ├── CornerMultiComboBoxItem.xaml │ │ ├── CornerProgressBar.xaml │ │ ├── CornerRadioButton.xaml │ │ ├── CornerSlider.xaml │ │ ├── CornerTabControl.xaml │ │ ├── CornerTabItem.xaml │ │ ├── CornerTextBox.xaml │ │ ├── CornerToolTip.xaml │ │ └── CornerTreeView.xaml ├── VMFactory │ ├── ViewModelBase.cs │ └── ViewModelFactory.cs ├── WPFTemplate.csproj ├── common │ ├── ButtonHelper.cs │ ├── ComboBoxViewFilterHelper.cs │ ├── Converters.cs │ ├── LocalLogicalTreeHelper.cs │ ├── LocalVisualTreeHelper.cs │ ├── ModelConvertHelper.cs │ └── TreeViewItemHelper.cs ├── packages.config ├── test.xaml └── test.xaml.cs ├── Wpf063Demo ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Model │ └── MainFunction.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── logo.png │ ├── main.png │ ├── profile4.jpg │ └── smallpng │ │ ├── aqdn.png │ │ ├── fhzx.png │ │ ├── mmcs.png │ │ ├── qljs.png │ │ ├── qsnms.png │ │ ├── rjgj.png │ │ ├── sjan.png │ │ ├── tcgl.png │ │ ├── wlaq.png │ │ └── xtqd.png ├── View │ ├── LoginView.xaml │ └── LoginView.xaml.cs ├── ViewModel │ ├── MainViewModel.cs │ └── ViewModelLocator.cs ├── Wpf063Demo.csproj └── packages.config ├── WpfBootstrap ├── App.config ├── App.xaml ├── App.xaml.cs ├── Common │ └── Converters.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Model │ ├── CornerPaginationModel.cs │ ├── Revenue.cs │ ├── TreeViewModel.cs │ ├── UnicodeModel.cs │ └── WorkScream.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── 08.jpg │ ├── Mountain.jpg │ ├── Orange.jpg │ ├── ice.jpg │ ├── island.jpg │ ├── profile1.jpg │ ├── profile10.jpg │ ├── profile11.jpg │ ├── profile2.jpg │ ├── profile3.jpg │ ├── profile4.jpg │ ├── profile5.jpg │ ├── profile6.jpg │ ├── profile7.jpg │ ├── profile8.jpg │ └── profile9.jpg ├── View │ ├── BadgeView.xaml │ ├── BadgeView.xaml.cs │ ├── CardView.xaml │ ├── CardView.xaml.cs │ ├── CarouselView.xaml │ ├── CarouselView.xaml.cs │ ├── ChartCurveView.xaml │ ├── ChartCurveView.xaml.cs │ ├── ChartLineView.xaml │ ├── ChartLineView.xaml.cs │ ├── ChartsView.xaml │ ├── ChartsView.xaml.cs │ ├── ColorSliderView.xaml │ ├── ColorSliderView.xaml.cs │ ├── CornerButtonView.xaml │ ├── CornerButtonView.xaml.cs │ ├── CornerCalendarView.xaml │ ├── CornerCalendarView.xaml.cs │ ├── CornerCheckBoxView.xaml │ ├── CornerCheckBoxView.xaml.cs │ ├── CornerComboBoxView.xaml │ ├── CornerComboBoxView.xaml.cs │ ├── CornerContextMenuView.xaml │ ├── CornerContextMenuView.xaml.cs │ ├── CornerDatePickerView.xaml │ ├── CornerDatePickerView.xaml.cs │ ├── CornerExpanderView.xaml │ ├── CornerExpanderView.xaml.cs │ ├── CornerMultiComboBoxView.xaml │ ├── CornerMultiComboBoxView.xaml.cs │ ├── CornerPaginationView.xaml │ ├── CornerPaginationView.xaml.cs │ ├── CornerPasswordBoxView.xaml │ ├── CornerPasswordBoxView.xaml.cs │ ├── CornerProgressBarView.xaml │ ├── CornerProgressBarView.xaml.cs │ ├── CornerRadioButtonView.xaml │ ├── CornerRadioButtonView.xaml.cs │ ├── CornerSliderView.xaml │ ├── CornerSliderView.xaml.cs │ ├── CornerTabControlView.xaml │ ├── CornerTabControlView.xaml.cs │ ├── CornerToolTipView.xaml │ ├── CornerToolTipView.xaml.cs │ ├── CornerTreeViewView.xaml │ ├── CornerTreeViewView.xaml.cs │ ├── DonutView.xaml │ ├── DonutView.xaml.cs │ ├── DrawerView.xaml │ ├── DrawerView.xaml.cs │ ├── HomeTableEditView.xaml │ ├── HomeTableEditView.xaml.cs │ ├── HomeView.xaml │ ├── HomeView.xaml.cs │ ├── HoverView.xaml │ ├── HoverView.xaml.cs │ ├── LoadingView.xaml │ ├── LoadingView.xaml.cs │ ├── NoticeBarView.xaml │ ├── NoticeBarView.xaml.cs │ ├── NotifyWindowView.xaml │ ├── NotifyWindowView.xaml.cs │ ├── PlaceControlView.xaml │ ├── PlaceControlView.xaml.cs │ ├── StepsView.xaml │ ├── StepsView.xaml.cs │ ├── ToastView.xaml │ ├── ToastView.xaml.cs │ ├── UnicodeView.xaml │ └── UnicodeView.xaml.cs ├── ViewModel │ ├── CornerPaginationViewModel.cs │ ├── HomeViewModel.cs │ ├── MainViewModel.cs │ ├── TreeViewViewModel.cs │ └── UnicodeViewModel.cs ├── ViewModelFactory │ └── VmFactory.cs └── WpfBootstrap.csproj └── WpfQQDemo ├── App.config ├── App.xaml ├── App.xaml.cs ├── Data └── Db.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Model ├── GroupUser.cs ├── QQGroup.cs ├── QQMessage.cs ├── QQRelation.cs └── QQUser.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources ├── profile5.jpg ├── profile6.jpg ├── profile7.jpg ├── profile8.jpg └── profile9.jpg ├── ViewModel └── QQViewModel.cs ├── VmFactory.cs ├── WpfQQDemo.csproj └── WpfQQDemo.csproj.user /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8618: 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。 4 | dotnet_diagnostic.CS8618.severity = none 5 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /MyWPF.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFTemplate", "WPFTemplate\WPFTemplate.csproj", "{9CE3053E-547F-47F4-A087-0224A3953218}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfBootstrap", "WpfBootstrap\WpfBootstrap.csproj", "{C83A8E57-F415-47B7-A041-6BC8590BC1AF}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf063Demo", "Wpf063Demo\Wpf063Demo.csproj", "{FF9FAF19-3CD3-4D97-948C-B3019D887F74}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfQQDemo", "WpfQQDemo\WpfQQDemo.csproj", "{6CBC005D-E23C-47EF-B84E-045ED0DC6C02}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfTest", "WpfTest\WpfTest.csproj", "{31509D7E-921B-4201-B71A-CD3168EF9C34}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {9CE3053E-547F-47F4-A087-0224A3953218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {9CE3053E-547F-47F4-A087-0224A3953218}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {9CE3053E-547F-47F4-A087-0224A3953218}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {9CE3053E-547F-47F4-A087-0224A3953218}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {C83A8E57-F415-47B7-A041-6BC8590BC1AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {C83A8E57-F415-47B7-A041-6BC8590BC1AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {C83A8E57-F415-47B7-A041-6BC8590BC1AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {C83A8E57-F415-47B7-A041-6BC8590BC1AF}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {FF9FAF19-3CD3-4D97-948C-B3019D887F74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {FF9FAF19-3CD3-4D97-948C-B3019D887F74}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {FF9FAF19-3CD3-4D97-948C-B3019D887F74}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {FF9FAF19-3CD3-4D97-948C-B3019D887F74}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {6CBC005D-E23C-47EF-B84E-045ED0DC6C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {6CBC005D-E23C-47EF-B84E-045ED0DC6C02}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {6CBC005D-E23C-47EF-B84E-045ED0DC6C02}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {6CBC005D-E23C-47EF-B84E-045ED0DC6C02}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {31509D7E-921B-4201-B71A-CD3168EF9C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {31509D7E-921B-4201-B71A-CD3168EF9C34}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {31509D7E-921B-4201-B71A-CD3168EF9C34}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {31509D7E-921B-4201-B71A-CD3168EF9C34}.Release|Any CPU.Build.0 = Release|Any CPU 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | GlobalSection(ExtensibilityGlobals) = postSolution 47 | SolutionGuid = {EDB38FA8-A7D3-4CDC-8507-D6DA73CEC9A8} 48 | EndGlobalSection 49 | EndGlobal 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /WPFTemplate/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WPFTemplate/Command/CommandBase.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.Input; 8 | 9 | namespace WPFTemplate 10 | { 11 | public class CommandBase : ICommand 12 | { 13 | public event EventHandler CanExecuteChanged; 14 | 15 | public Action AcExecute { get; set; } 16 | 17 | public Func FcCanExecute { get; set; } 18 | 19 | public CommandBase(Action execute, Func canExecute) 20 | { 21 | this.AcExecute = execute; 22 | this.FcCanExecute = canExecute; 23 | } 24 | public CommandBase(Action execute) 25 | { 26 | this.AcExecute = execute; 27 | this.FcCanExecute = (o) => 28 | { 29 | return true; 30 | }; 31 | } 32 | public bool CanExecute(object parameter) 33 | { 34 | if (FcCanExecute != null) 35 | { 36 | return FcCanExecute(parameter); 37 | } 38 | return false; 39 | } 40 | public void Execute(object parameter) 41 | { 42 | AcExecute(parameter); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /WPFTemplate/Command/CommandCenter.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.Input; 9 | 10 | namespace WPFTemplate 11 | { 12 | public class CommandCenter 13 | { 14 | public static readonly DependencyProperty EventProperty; 15 | 16 | public static readonly DependencyProperty CommandProperty; 17 | 18 | public static readonly DependencyProperty CommandParameterProperty; 19 | 20 | static CommandCenter() 21 | { 22 | EventProperty = DependencyProperty.RegisterAttached("Event", typeof(RoutedEvent), typeof(CommandCenter), 23 | new FrameworkPropertyMetadata(null,FrameworkPropertyMetadataOptions.None,new PropertyChangedCallback(EventPropertyChangedCallBack))); 24 | CommandProperty = DependencyProperty.RegisterAttached("Command", typeof(ICommand), typeof(CommandCenter)); 25 | CommandParameterProperty = DependencyProperty.RegisterAttached("CommandParameter", typeof(object), typeof(CommandCenter)); 26 | } 27 | private static void EventPropertyChangedCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e) 28 | { 29 | var control = d as Control; 30 | if (control != null) 31 | { 32 | control.AddHandler(e.NewValue as RoutedEvent, new RoutedEventHandler((o, s) => 33 | { 34 | var command = d.GetValue(CommandProperty) as ICommand; 35 | var commandParameter = d.GetValue(CommandParameterProperty); 36 | if (command != null) 37 | { 38 | command.Execute(commandParameter); 39 | } 40 | })); 41 | } 42 | } 43 | public static RoutedEvent GetEvent(DependencyObject obj) 44 | { 45 | return (RoutedEvent)obj.GetValue(EventProperty); 46 | } 47 | public static void SetEvent(DependencyObject obj, RoutedEvent value) 48 | { 49 | obj.SetValue(EventProperty, value); 50 | } 51 | public static ICommand GetCommand(DependencyObject obj) 52 | { 53 | return (ICommand)obj.GetValue(CommandProperty); 54 | } 55 | public static void SetCommand(DependencyObject obj, ICommand value) 56 | { 57 | obj.SetValue(CommandProperty, value); 58 | } 59 | public static object GetCommandParameter(DependencyObject obj) 60 | { 61 | return (object)obj.GetValue(CommandParameterProperty); 62 | } 63 | public static void SetCommandParameter(DependencyObject obj, object value) 64 | { 65 | obj.SetValue(CommandParameterProperty, value); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Chart/Bar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Collections.Specialized; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Controls; 11 | using System.Windows.Data; 12 | using System.Windows.Documents; 13 | using System.Windows.Input; 14 | using System.Windows.Media; 15 | using System.Windows.Media.Imaging; 16 | using System.Windows.Navigation; 17 | using System.Windows.Shapes; 18 | 19 | namespace WPFTemplate 20 | { 21 | public class Bar : Chart 22 | { 23 | protected override DependencyObject GetContainerForItemOverride() 24 | { 25 | return new BarItem(); 26 | } 27 | protected override bool IsItemItsOwnContainerOverride(object item) 28 | { 29 | return item is BarItem; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Chart/BarItem.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace WPFTemplate 18 | { 19 | public class BarItem : ChartItem 20 | { 21 | static BarItem() 22 | { 23 | DefaultStyleKeyProperty.OverrideMetadata(typeof(BarItem), new FrameworkPropertyMetadata(typeof(BarItem))); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Chart/ChartItem.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace WPFTemplate 18 | { 19 | public class ChartItem : ContentControl 20 | { 21 | private static readonly DependencyPropertyKey ValuePropertyKey; 22 | 23 | public static readonly DependencyProperty ValueProperty; 24 | 25 | public bool IsInDesignMode => System.ComponentModel.DesignerProperties.GetIsInDesignMode(this); 26 | 27 | public double Value 28 | { 29 | get 30 | { 31 | return (double)GetValue(ValueProperty); 32 | } 33 | } 34 | 35 | private Chart ParentChart; 36 | 37 | static ChartItem() 38 | { 39 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ChartItem), new FrameworkPropertyMetadata(typeof(ChartItem))); 40 | ValuePropertyKey = DependencyProperty.RegisterReadOnly("Value", typeof(double), typeof(BarItem), new PropertyMetadata((double)0)); 41 | ValueProperty = ValuePropertyKey.DependencyProperty; 42 | } 43 | 44 | public override void OnApplyTemplate() 45 | { 46 | base.OnApplyTemplate(); 47 | ParentChart = LocalVisualTreeHelper.GetParent(this, typeof(Chart)) as Chart; 48 | CalculateValue(); 49 | } 50 | 51 | private void CalculateValue() 52 | { 53 | var chart = LocalVisualTreeHelper.GetParent(this, typeof(Chart)) as Chart; 54 | if (chart != null && chart.ItemsSource != null && !string.IsNullOrWhiteSpace(chart.ValueMemberPath)) 55 | { 56 | double value = 0; 57 | if (double.TryParse(Content.GetType().GetProperty(chart.ValueMemberPath).GetValue(Content).ToString(), out value)) 58 | { 59 | SetValue(ValuePropertyKey, value); 60 | } 61 | } 62 | } 63 | 64 | //private void CreateAnimation(double from, double to, DependencyObject d) 65 | //{ 66 | // Storyboard storyboard = new Storyboard(); 67 | // DoubleAnimationUsingKeyFrames animation = new DoubleAnimationUsingKeyFrames(); 68 | // animation.FillBehavior = FillBehavior.Stop; 69 | // animation.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.Zero, Value = from }); 70 | // animation.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromMilliseconds(500), Value = to }); 71 | // Storyboard.SetTarget(animation, d); 72 | // Storyboard.SetTargetProperty(animation, new PropertyPath("Height")); 73 | // storyboard.Children.Add(animation); 74 | // storyboard.Begin(); 75 | //} 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Chart/LineChart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 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 WPFTemplate 18 | { 19 | public class LineChart : Chart 20 | { 21 | protected override void GeneratePath() 22 | { 23 | if (Segments == null) 24 | { 25 | Segments = new PathSegmentCollection(); 26 | } 27 | else 28 | { 29 | Segments.Clear(); 30 | } 31 | if (itemPresenter != null && this.ItemsSource != null && !string.IsNullOrWhiteSpace(ValueMemberPath)) 32 | { 33 | double pointX = Math.Round(itemPresenter.ActualWidth / this.Items.Count, 2); 34 | for (int i = 0; i < this.Items.Count; i++) 35 | { 36 | var item = Items[i]; 37 | if (double.TryParse(item.GetType().GetProperty(ValueMemberPath).GetValue(item).ToString(), out double value)) 38 | { 39 | var pointY = Math.Round(Math.Floor(this.ActualHeight / this.VerticalNumbers.Count) * value / Ratio, 2); 40 | Segments.Add(GenerateSegment(pointX * i, pointY)); 41 | } 42 | } 43 | } 44 | 45 | if (Segments.Count > 1) 46 | { 47 | var startPoint = (Segments[0] as LineSegment).Point; 48 | var endPoint = (Segments[Segments.Count - 1] as LineSegment).Point; 49 | Segments.Add(GenerateSegment(endPoint.X, 0, false)); 50 | Segments.Add(GenerateSegment(startPoint.X, 0, false)); 51 | Segments.Add(GenerateSegment(startPoint.X, startPoint.Y, false)); 52 | } 53 | } 54 | 55 | private PathSegment GenerateSegment(double x, double y, bool isStroked = true) 56 | { 57 | return new LineSegment(new Point(x, y), isStroked); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Chart/StepChart.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.Media; 8 | 9 | namespace WPFTemplate 10 | { 11 | public class StepChart : Chart 12 | { 13 | protected override void GeneratePath() 14 | { 15 | if (Segments == null) 16 | { 17 | Segments = new PathSegmentCollection(); 18 | } 19 | else 20 | { 21 | Segments.Clear(); 22 | } 23 | if (itemPresenter != null && this.ItemsSource != null && !string.IsNullOrWhiteSpace(ValueMemberPath)) 24 | { 25 | double pointX = Math.Round(itemPresenter.ActualWidth / this.Items.Count, 2); 26 | if (this.Items.Count > 1) 27 | { 28 | for (int i = 0; i < this.Items.Count; i++) 29 | { 30 | var item = Items[i]; 31 | var bo1 = double.TryParse(item.GetType().GetProperty(ValueMemberPath).GetValue(item).ToString(), out double value); 32 | if (bo1) 33 | { 34 | var pointY = Math.Round(Math.Floor(this.ActualHeight / this.VerticalNumbers.Count) * value / Ratio, 2); 35 | Segments.Add(GenerateSegment(pointX * i, pointY)); 36 | Segments.Add(GenerateSegment(pointX * (i + 1), pointY)); 37 | } 38 | if (i == this.Items.Count - 1) 39 | { 40 | Segments.RemoveAt(Segments.Count - 1); 41 | } 42 | } 43 | } 44 | } 45 | 46 | if (Segments.Count > 1) 47 | { 48 | var startPoint = (Segments[0] as LineSegment).Point; 49 | var endPoint = (Segments[Segments.Count - 1] as LineSegment).Point; 50 | Segments.Add(GenerateSegment(endPoint.X, 0, false)); 51 | Segments.Add(GenerateSegment(startPoint.X, 0, false)); 52 | Segments.Add(GenerateSegment(startPoint.X, startPoint.Y, false)); 53 | } 54 | } 55 | 56 | private PathSegment GenerateSegment(double x, double y, bool isStroked = true) 57 | { 58 | return new LineSegment(new Point(x, y), isStroked); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/ColorSlider.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/CornerMultiComboBoxItem.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 WPFTemplate 17 | { 18 | public class CornerMultiComboBoxItem : ListBoxItem 19 | { 20 | private CornerMultiComboBox parentComboBox => ItemsControl.ItemsControlFromItemContainer(this) as CornerMultiComboBox; 21 | 22 | static CornerMultiComboBoxItem() 23 | { 24 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerMultiComboBoxItem), new FrameworkPropertyMetadata(typeof(CornerMultiComboBoxItem))); 25 | } 26 | 27 | protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e) 28 | { 29 | base.OnPreviewMouseLeftButtonDown(e); 30 | //e.Handled = true; 31 | this.IsSelected = !this.IsSelected; 32 | if (parentComboBox != null) 33 | { 34 | parentComboBox.UpdateText(); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/DrawerItem.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 WPFTemplate 17 | { 18 | public class DrawerItem : ContentControl 19 | { 20 | 21 | public static readonly DependencyProperty CornerRadiusProperty; 22 | 23 | public CornerRadius CornerRadius 24 | { 25 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 26 | set { SetValue(CornerRadiusProperty, value); } 27 | } 28 | 29 | static DrawerItem() 30 | { 31 | DefaultStyleKeyProperty.OverrideMetadata(typeof(DrawerItem), new FrameworkPropertyMetadata(typeof(DrawerItem))); 32 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(DrawerItem)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/Loading.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 WPFTemplate 17 | { 18 | public class Loading : Control 19 | { 20 | public static readonly DependencyProperty LoadingTypeProperty; 21 | 22 | public LoadingType LoadingType 23 | { 24 | get { return (LoadingType)GetValue(LoadingTypeProperty); } 25 | set { SetValue(LoadingTypeProperty, value); } 26 | } 27 | 28 | static Loading() 29 | { 30 | DefaultStyleKeyProperty.OverrideMetadata(typeof(Loading), new FrameworkPropertyMetadata(typeof(Loading))); 31 | LoadingTypeProperty = DependencyProperty.Register("LoadingType", typeof(LoadingType), typeof(Loading), new PropertyMetadata(LoadingType.Type1)); 32 | } 33 | } 34 | 35 | public enum LoadingType 36 | { 37 | Type1, 38 | Type2 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/NoticeBar.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace WPFTemplate 18 | { 19 | public class NoticeBar : ContentControl 20 | { 21 | private ContentPresenter contentPresenter { get; set; } 22 | 23 | private bool IsInDesignMode => System.ComponentModel.DesignerProperties.GetIsInDesignMode(this); 24 | 25 | static NoticeBar() 26 | { 27 | DefaultStyleKeyProperty.OverrideMetadata(typeof(NoticeBar), new FrameworkPropertyMetadata(typeof(NoticeBar))); 28 | } 29 | 30 | public NoticeBar() 31 | { 32 | this.Loaded += (s, e) => 33 | { 34 | Initialize(); 35 | }; 36 | } 37 | 38 | private void Initialize() 39 | { 40 | if (this.contentPresenter != null && !IsInDesignMode) 41 | { 42 | var width = contentPresenter.ActualWidth; 43 | contentPresenter.Margin = new Thickness 44 | { 45 | Right = 0 - Math.Floor(width) - 5 46 | }; 47 | CreateAnimation(); 48 | } 49 | } 50 | 51 | private void CreateAnimation() 52 | { 53 | Storyboard storyboard = new Storyboard(); 54 | DoubleAnimationUsingKeyFrames animation = new DoubleAnimationUsingKeyFrames 55 | { 56 | KeyFrames = new DoubleKeyFrameCollection 57 | { 58 | new EasingDoubleKeyFrame{ KeyTime = TimeSpan.Zero, Value = 0 }, 59 | new EasingDoubleKeyFrame{ KeyTime = TimeSpan.FromSeconds(12),Value = 0 - (this.ActualWidth + contentPresenter.ActualWidth + 5)} 60 | } 61 | }; 62 | storyboard.RepeatBehavior = RepeatBehavior.Forever; 63 | storyboard.Children.Add(animation); 64 | Storyboard.SetTarget(animation, contentPresenter); 65 | Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)")); 66 | storyboard.Begin(); 67 | } 68 | 69 | public override void OnApplyTemplate() 70 | { 71 | base.OnApplyTemplate(); 72 | contentPresenter = GetTemplateChild("contentPresenter") as ContentPresenter; 73 | } 74 | 75 | protected override void OnContentChanged(object oldContent, object newContent) 76 | { 77 | base.OnContentChanged(oldContent, newContent); 78 | Initialize(); 79 | } 80 | 81 | protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) 82 | { 83 | base.OnRenderSizeChanged(sizeInfo); 84 | Initialize(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/Steps.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 WPFTemplate 17 | { 18 | public class Steps : ListBox 19 | { 20 | static Steps() 21 | { 22 | DefaultStyleKeyProperty.OverrideMetadata(typeof(Steps), new FrameworkPropertyMetadata(typeof(Steps))); 23 | } 24 | 25 | protected override bool IsItemItsOwnContainerOverride(object item) 26 | { 27 | return item is StepsItem; 28 | } 29 | 30 | protected override DependencyObject GetContainerForItemOverride() 31 | { 32 | return new StepsItem(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/StepsItem.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 WPFTemplate 18 | { 19 | public class StepsItem : ListBoxItem 20 | { 21 | static StepsItem() 22 | { 23 | DefaultStyleKeyProperty.OverrideMetadata(typeof(StepsItem), new FrameworkPropertyMetadata(typeof(StepsItem))); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/Toast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using WPFTemplate.Controls.Extra; 7 | 8 | namespace WPFTemplate 9 | { 10 | public enum ToastType 11 | { 12 | Info, 13 | Error, 14 | Warning, 15 | Success 16 | } 17 | 18 | public class Toast 19 | { 20 | private Toast() 21 | { 22 | 23 | } 24 | 25 | public static void Show(string msg) 26 | { 27 | ToastWindow toastWindow = new ToastWindow(); 28 | toastWindow.Text = msg; 29 | toastWindow.Show(); 30 | } 31 | 32 | public static void Show(string msg, ToastType toastType) 33 | { 34 | ToastWindow toastWindow = new ToastWindow(); 35 | toastWindow.Text = msg; 36 | toastWindow.ToastType = toastType; 37 | toastWindow.Show(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Extra/ToastWindow.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Shapes; 15 | using System.Windows.Threading; 16 | 17 | namespace WPFTemplate.Controls.Extra 18 | { 19 | /// 20 | /// ToastWindow.xaml 的交互逻辑 21 | /// 22 | public partial class ToastWindow : Window 23 | { 24 | public static readonly DependencyProperty ToastTypeProperty = 25 | DependencyProperty.Register("ToastType", typeof(ToastType), typeof(ToastWindow), new PropertyMetadata(ToastType.Info)); 26 | 27 | public static readonly DependencyProperty TextProperty = 28 | DependencyProperty.Register("Text", typeof(string), typeof(ToastWindow), new PropertyMetadata(string.Empty)); 29 | 30 | public ToastType ToastType 31 | { 32 | get { return (ToastType)GetValue(ToastTypeProperty); } 33 | set { SetValue(ToastTypeProperty, value); } 34 | } 35 | 36 | public string Text 37 | { 38 | get { return (string)GetValue(TextProperty); } 39 | set { SetValue(TextProperty, value); } 40 | } 41 | 42 | public ToastWindow() 43 | { 44 | InitializeComponent(); 45 | DispatcherTimer timer = new DispatcherTimer(); 46 | timer.Interval = TimeSpan.FromSeconds(3.5); 47 | timer.Tick += (a, b) => 48 | { 49 | this.Close(); 50 | }; 51 | timer.Start(); 52 | } 53 | 54 | private void Window_Loaded(object sender, RoutedEventArgs e) 55 | { 56 | var animation = FindResource("FadeInOutStoryboard") as Storyboard; 57 | animation.Begin(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerCalendar.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 WPFTemplate 18 | { 19 | /// 20 | /// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。 21 | /// 22 | /// 步骤 1a) 在当前项目中存在的 XAML 文件中使用该自定义控件。 23 | /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 24 | /// 元素中: 25 | /// 26 | /// xmlns:MyNamespace="clr-namespace:WPFTemplate.Controls.Extend" 27 | /// 28 | /// 29 | /// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。 30 | /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 31 | /// 元素中: 32 | /// 33 | /// xmlns:MyNamespace="clr-namespace:WPFTemplate.Controls.Extend;assembly=WPFTemplate.Controls.Extend" 34 | /// 35 | /// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用, 36 | /// 并重新生成以避免编译错误: 37 | /// 38 | /// 在解决方案资源管理器中右击目标项目,然后依次单击 39 | /// “添加引用”->“项目”->[浏览查找并选择此项目] 40 | /// 41 | /// 42 | /// 步骤 2) 43 | /// 继续操作并在 XAML 文件中使用控件。 44 | /// 45 | /// 46 | /// 47 | /// 48 | public class CornerCalendar : Calendar 49 | { 50 | public static readonly DependencyProperty HighLightColorProperty; 51 | 52 | public Brush HighLightColor 53 | { 54 | get { return (Brush)GetValue(HighLightColorProperty); } 55 | set { SetValue(HighLightColorProperty, value); } 56 | } 57 | 58 | static CornerCalendar() 59 | { 60 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerCalendar), new FrameworkPropertyMetadata(typeof(CornerCalendar))); 61 | HighLightColorProperty = DependencyProperty.Register("HighLightColor", typeof(Brush), typeof(CornerCalendar), new PropertyMetadata(Brushes.Red)); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerContextMenu.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 WPFTemplate 17 | { 18 | public class CornerContextMenu : ContextMenu 19 | { 20 | public static readonly DependencyProperty CornerRadiusProperty; 21 | 22 | public CornerRadius CornerRadius 23 | { 24 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 25 | set { SetValue(CornerRadiusProperty, value); } 26 | } 27 | 28 | static CornerContextMenu() 29 | { 30 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerContextMenu), new FrameworkPropertyMetadata(typeof(CornerContextMenu))); 31 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerContextMenu), new PropertyMetadata(new CornerRadius(0))); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerDatePicker.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 WPFTemplate 17 | { 18 | public class CornerDatePicker : DatePicker 19 | { 20 | public static readonly DependencyProperty CornerRadiusProperty; 21 | 22 | public CornerRadius CornerRadius 23 | { 24 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 25 | set { SetValue(CornerRadiusProperty, value); } 26 | } 27 | 28 | static CornerDatePicker() 29 | { 30 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerDatePicker), new FrameworkPropertyMetadata(typeof(CornerDatePicker))); 31 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerDatePicker)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerMenu.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 WPFTemplate 10 | { 11 | public class CornerMenu : Menu 12 | { 13 | static CornerMenu() 14 | { 15 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerMenu), new FrameworkPropertyMetadata(typeof(CornerMenu))); 16 | } 17 | 18 | protected override bool IsItemItsOwnContainerOverride(object item) 19 | { 20 | return item is CornerMenuItem; 21 | } 22 | 23 | protected override DependencyObject GetContainerForItemOverride() 24 | { 25 | return new CornerMenuItem(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerMenuItem.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 WPFTemplate 17 | { 18 | public class CornerMenuItem : MenuItem 19 | { 20 | public static new readonly DependencyProperty IconProperty; 21 | 22 | public static readonly DependencyProperty CornerRadiusProperty; 23 | 24 | public new string Icon 25 | { 26 | get { return (string)GetValue(IconProperty); } 27 | set { SetValue(IconProperty, value); } 28 | } 29 | public CornerRadius CornerRadius 30 | { 31 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 32 | set { SetValue(CornerRadiusProperty, value); } 33 | } 34 | 35 | static CornerMenuItem() 36 | { 37 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerMenuItem), new FrameworkPropertyMetadata(typeof(CornerMenuItem))); 38 | IconProperty = DependencyProperty.Register("Icon", typeof(string), typeof(CornerMenuItem), new PropertyMetadata(null)); 39 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerMenuItem), new PropertyMetadata(new CornerRadius(0))); 40 | } 41 | 42 | protected override DependencyObject GetContainerForItemOverride() 43 | { 44 | return new CornerMenuItem(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerRadioButton.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace WPFTemplate 18 | { 19 | public class CornerRadioButton : RadioButton 20 | { 21 | public static readonly DependencyProperty RadioButtonTypeProperty; 22 | 23 | public static readonly DependencyProperty CornerRadiusProperty; 24 | 25 | public RadioButtonType RadioButtonType 26 | { 27 | get { return (RadioButtonType)GetValue(RadioButtonTypeProperty); } 28 | set { SetValue(RadioButtonTypeProperty, value); } 29 | } 30 | public CornerRadius CornerRadius 31 | { 32 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 33 | set { SetValue(CornerRadiusProperty, value); } 34 | } 35 | 36 | static CornerRadioButton() 37 | { 38 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerRadioButton), new FrameworkPropertyMetadata(typeof(CornerRadioButton))); 39 | RadioButtonTypeProperty = DependencyProperty.Register("RadioButtonType", typeof(RadioButtonType), typeof(CornerRadioButton), new PropertyMetadata(RadioButtonType.Normal)); 40 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerRadioButton)); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerSlider.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 WPFTemplate 18 | { 19 | public class CornerSlider : Slider 20 | { 21 | public static readonly DependencyProperty TrackThicknessProperty; 22 | 23 | public static readonly DependencyProperty SliderTypeProperty; 24 | 25 | public static readonly DependencyProperty CornerRadiusProperty; 26 | 27 | public static readonly DependencyProperty TrackBackgroundProperty; 28 | 29 | public double TrackThickness 30 | { 31 | get { return (double)GetValue(TrackThicknessProperty); } 32 | set { SetValue(TrackThicknessProperty, value); } 33 | } 34 | public SliderType SliderType 35 | { 36 | get { return (SliderType)GetValue(SliderTypeProperty); } 37 | set { SetValue(SliderTypeProperty, value); } 38 | } 39 | public CornerRadius CornerRadius 40 | { 41 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 42 | set { SetValue(CornerRadiusProperty, value); } 43 | } 44 | public Brush TrackBackground 45 | { 46 | get { return (Brush)GetValue(TrackBackgroundProperty); } 47 | set { SetValue(TrackBackgroundProperty, value); } 48 | } 49 | 50 | static CornerSlider() 51 | { 52 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerSlider), new FrameworkPropertyMetadata(typeof(CornerSlider))); 53 | TrackThicknessProperty = DependencyProperty.Register("TrackThickness", typeof(double), typeof(CornerSlider), new PropertyMetadata(double.Parse("2"))); 54 | SliderTypeProperty = DependencyProperty.Register("SliderType", typeof(SliderType), typeof(CornerSlider)); 55 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerSlider)); 56 | TrackBackgroundProperty = DependencyProperty.Register("TrackBackground", typeof(Brush), typeof(CornerSlider), 57 | new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFE7EAEA")))); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerTabItem.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 WPFTemplate 17 | { 18 | public class CornerTabItem : TabItem 19 | { 20 | static CornerTabItem() 21 | { 22 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerTabItem), new FrameworkPropertyMetadata(typeof(CornerTabItem))); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerTextBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 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.Animation; 14 | using System.Windows.Media.Effects; 15 | using System.Windows.Media.Imaging; 16 | using System.Windows.Navigation; 17 | using System.Windows.Shapes; 18 | 19 | namespace WPFTemplate 20 | { 21 | public class CornerTextBox : TextBox 22 | { 23 | public static readonly DependencyProperty CornerRadiusProperty; 24 | 25 | public static readonly DependencyProperty IconProperty; 26 | 27 | public static readonly DependencyProperty WaterTextProperty; 28 | 29 | public static readonly DependencyProperty ShowWaterTextProperty; 30 | 31 | public static readonly DependencyProperty PressShowShadowProperty; 32 | 33 | public CornerRadius CornerRadius 34 | { 35 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 36 | set { SetValue(CornerRadiusProperty, value); } 37 | } 38 | public string Icon 39 | { 40 | get { return (string)GetValue(IconProperty); } 41 | set { SetValue(IconProperty, value); } 42 | } 43 | public string WaterText 44 | { 45 | get { return (string)GetValue(WaterTextProperty); } 46 | set { SetValue(WaterTextProperty, value); } 47 | } 48 | public bool ShowWaterText 49 | { 50 | get { return (bool)GetValue(ShowWaterTextProperty); } 51 | set { SetValue(ShowWaterTextProperty, value); } 52 | } 53 | public bool PressShowShadow 54 | { 55 | get { return (bool)GetValue(PressShowShadowProperty); } 56 | set { SetValue(PressShowShadowProperty, value); } 57 | } 58 | 59 | static CornerTextBox() 60 | { 61 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerTextBox), new FrameworkPropertyMetadata(typeof(CornerTextBox))); 62 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerTextBox)); 63 | IconProperty = DependencyProperty.Register("Icon", typeof(string), typeof(CornerTextBox), new PropertyMetadata(null)); 64 | WaterTextProperty = DependencyProperty.Register("WaterText", typeof(string), typeof(CornerTextBox), new PropertyMetadata("WaterText")); 65 | ShowWaterTextProperty = DependencyProperty.Register("ShowWaterText", typeof(bool), typeof(CornerTextBox), new PropertyMetadata(true)); 66 | PressShowShadowProperty = DependencyProperty.Register("PressShowShadow", typeof(bool), typeof(CornerTextBox), new PropertyMetadata(true)); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /WPFTemplate/Controls/Original/CornerToolTip.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 WPFTemplate 17 | { 18 | /// 19 | /// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。 20 | /// 21 | /// 步骤 1a) 在当前项目中存在的 XAML 文件中使用该自定义控件。 22 | /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 23 | /// 元素中: 24 | /// 25 | /// xmlns:MyNamespace="clr-namespace:WPFTemplate.Controls" 26 | /// 27 | /// 28 | /// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。 29 | /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 30 | /// 元素中: 31 | /// 32 | /// xmlns:MyNamespace="clr-namespace:WPFTemplate.Controls;assembly=WPFTemplate.Controls" 33 | /// 34 | /// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用, 35 | /// 并重新生成以避免编译错误: 36 | /// 37 | /// 在解决方案资源管理器中右击目标项目,然后依次单击 38 | /// “添加引用”->“项目”->[浏览查找并选择此项目] 39 | /// 40 | /// 41 | /// 步骤 2) 42 | /// 继续操作并在 XAML 文件中使用控件。 43 | /// 44 | /// 45 | /// 46 | /// 47 | public class CornerToolTip : ToolTip 48 | { 49 | 50 | public static readonly DependencyProperty CornerRadiusProperty; 51 | 52 | public CornerRadius CornerRadius 53 | { 54 | get { return (CornerRadius)GetValue(CornerRadiusProperty); } 55 | set { SetValue(CornerRadiusProperty, value); } 56 | } 57 | 58 | static CornerToolTip() 59 | { 60 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CornerToolTip), new FrameworkPropertyMetadata(typeof(CornerToolTip))); 61 | CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(CornerToolTip)); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/ButtonEnum.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 WPFTemplate 8 | { 9 | public enum ButtonType 10 | { 11 | Normal, 12 | OutLine, 13 | Link 14 | } 15 | 16 | public enum ButtonIcon 17 | { 18 | None, 19 | Default, 20 | Add, 21 | Update, 22 | Delete, 23 | Save, 24 | Cancel, 25 | Import, 26 | Export, 27 | Print, 28 | Set, 29 | Query, 30 | Copy, 31 | Refresh 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/CardType.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 WPFTemplate 8 | { 9 | public enum CardType 10 | { 11 | Classic, 12 | Modern 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/CheckBoxEnum.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 WPFTemplate 8 | { 9 | public enum CheckBoxType 10 | { 11 | Normal, 12 | Switch 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/NotifySourceEnum.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 WPFTemplate 8 | { 9 | public enum NotifySourceEnum 10 | { 11 | System, 12 | Warn, 13 | Error 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/PlaceControlEnum.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 WPFTemplate 8 | { 9 | public enum PlaceMent 10 | { 11 | Bottom, 12 | Top, 13 | Left, 14 | Right, 15 | Center 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/ProgressBarEnum.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 WPFTemplate 8 | { 9 | public enum ProgressBarType 10 | { 11 | Normal, 12 | Cycle 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/RadioButtonEnums.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 WPFTemplate 8 | { 9 | public enum RadioButtonType 10 | { 11 | Normal, 12 | Switch 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/SliderEnum.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 WPFTemplate 8 | { 9 | public enum SliderType 10 | { 11 | Normal, 12 | Box 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/TabControlEnum.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 WPFTemplate 8 | { 9 | public enum TabControlType 10 | { 11 | Normal, 12 | Underline 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/TextBoxEnum.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 WPFTemplate 8 | { 9 | public enum TextBoxIcon 10 | { 11 | None, 12 | User, 13 | KeyBoard 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WPFTemplate/Enums/TreeViewEnum.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 WPFTemplate 8 | { 9 | public enum TreeViewType 10 | { 11 | Original, 12 | Normal, 13 | Line 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WPFTemplate/Images/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WPFTemplate/Images/test.png -------------------------------------------------------------------------------- /WPFTemplate/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using System.Linq; 3 | using System.Text; 4 | using System.Drawing.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Controls.Primitives; 8 | using System.Windows.Shapes; 9 | using System.Windows.Input; 10 | using System.Windows.Data; 11 | using System.Collections.Generic; 12 | using System.Collections.ObjectModel; 13 | using System; 14 | using System.Threading; 15 | using System.Threading.Tasks; 16 | using System.Windows.Media.Animation; 17 | using Microsoft.Expression.Shapes; 18 | using System.Windows.Media; 19 | using System.Collections.Specialized; 20 | using System.ComponentModel; 21 | 22 | namespace WPFTemplate 23 | { 24 | /// 25 | /// MainWindow.xaml 的交互逻辑 26 | /// 27 | public partial class MainWindow : Window, INotifyPropertyChanged 28 | { 29 | private ObservableCollection _list; 30 | 31 | public event PropertyChangedEventHandler PropertyChanged; 32 | 33 | public ObservableCollection list 34 | { 35 | get { return _list; } 36 | set 37 | { 38 | _list = value; 39 | if (PropertyChanged != null) 40 | { 41 | PropertyChanged.Invoke(this, new PropertyChangedEventArgs("list")); 42 | } 43 | } 44 | } 45 | 46 | public MainWindow() 47 | { 48 | InitializeComponent(); 49 | list = new ObservableCollection(); 50 | list.Add(new People 51 | { 52 | Name = "张三" 53 | }); 54 | } 55 | 56 | private void Button_Click(object sender, RoutedEventArgs e) 57 | { 58 | ObservableCollection peoples = new ObservableCollection 59 | { 60 | new People 61 | { 62 | Name = "李四" 63 | } 64 | }; 65 | list = peoples; 66 | } 67 | } 68 | 69 | public class People 70 | { 71 | public string Name { get; set; } 72 | public int Age { get; set; } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /WPFTemplate/NotifyPropertyChangedBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace WPFTemplate 10 | { 11 | public class NotifyPropertyChangedBase : INotifyPropertyChanged 12 | { 13 | public void RaisePropertyChanged([CallerMemberName] string PropertyName = null) 14 | { 15 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName)); 16 | } 17 | 18 | public event PropertyChangedEventHandler PropertyChanged; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /WPFTemplate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("WPFTemplate")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("WPFTemplate")] 15 | [assembly: AssemblyCopyright("Copyright © 2023")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /WPFTemplate/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WPFTemplate.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFTemplate.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /WPFTemplate/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WPFTemplate.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WPFTemplate/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WPFTemplate/Resources/Converters.xaml: -------------------------------------------------------------------------------- 1 |  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 | -------------------------------------------------------------------------------- /WPFTemplate/Resources/Microsoft.Expression.Drawing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WPFTemplate/Resources/Microsoft.Expression.Drawing.dll -------------------------------------------------------------------------------- /WPFTemplate/Resources/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WPFTemplate/Resources/iconfont.ttf -------------------------------------------------------------------------------- /WPFTemplate/Themes/Extra/Carousel.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Extra/DrawerItem.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | pack://application:,,,/WPFTemplate;component/Resources/iconfont.ttf#FatSheep 6 | 7 | 27 | 28 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Extra/NoticeBar.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | pack://application:,,,/WPFTemplate;component/Resources/iconfont.ttf#FatSheep 6 | 38 | 39 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Extra/Steps.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 43 | 44 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Original/CornerContextMenu.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 24 | 25 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Original/CornerMenu.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 25 | 26 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Original/CornerTabControl.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WPFTemplate/Themes/Original/CornerToolTip.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /WPFTemplate/VMFactory/ViewModelBase.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 WPFTemplate 8 | { 9 | public class ViewModelBase : NotifyPropertyChangedBase 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WPFTemplate/VMFactory/ViewModelFactory.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 WPFTemplate 8 | { 9 | public class ViewModelFactory 10 | { 11 | private static readonly object _locker = new object(); 12 | 13 | private readonly Dictionary _viewModels = new Dictionary(); 14 | 15 | private static ViewModelFactory _instance; 16 | 17 | public static ViewModelFactory Instance 18 | { 19 | get 20 | { 21 | if (_instance == null) 22 | { 23 | lock (_locker) 24 | { 25 | _instance = new ViewModelFactory(); 26 | } 27 | } 28 | return _instance; 29 | } 30 | } 31 | 32 | public ViewModelFactory() 33 | { 34 | 35 | } 36 | 37 | public T CreateInstance() where T : ViewModelBase 38 | { 39 | if (_viewModels.ContainsKey(typeof(T))) 40 | { 41 | return _viewModels[typeof(T)] as T; 42 | } 43 | var instance = Activator.CreateInstance(); 44 | _viewModels.Add(typeof(T), instance); 45 | 46 | return instance; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WPFTemplate/common/ComboBoxViewFilterHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows.Controls; 9 | using System.Windows.Input; 10 | 11 | namespace WPFTemplate 12 | { 13 | public class ComboBoxViewFilterHelper : ICommand 14 | { 15 | public event EventHandler CanExecuteChanged; 16 | 17 | public object ItemSource; 18 | 19 | public ComboBoxViewFilterHelper(object itemSource) 20 | { 21 | this.ItemSource = itemSource; 22 | } 23 | 24 | public bool CanExecute(object parameter) 25 | { 26 | return true; 27 | } 28 | 29 | public void Execute(object parameter) 30 | { 31 | if (!string.IsNullOrWhiteSpace(parameter.ToString())) 32 | { 33 | var keyvalues = parameter.ToString().Split('&'); 34 | var key = keyvalues[0]; 35 | var value = keyvalues[1]; 36 | 37 | if (ItemSource is DataView) 38 | { 39 | var filtercollection = $"{key} like '%{value}%'"; 40 | string filter = string.Join(" and ", filtercollection); 41 | var MainView = ItemSource as DataView; 42 | MainView.RowFilter = filter; 43 | } 44 | 45 | if(ItemSource is ICollectionView) 46 | { 47 | var MainView = ItemSource as ICollectionView; 48 | 49 | Predicate filter = item => 50 | { 51 | bool bo = true; 52 | if(item is string) 53 | { 54 | bo = item.ToString().Contains(value); 55 | } 56 | else 57 | { 58 | var dataItem = item.GetType().GetProperty(key).GetValue(item).ToString(); 59 | bo = dataItem.Contains(value); 60 | } 61 | return bo; 62 | }; 63 | MainView.Filter = filter; 64 | } 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /WPFTemplate/common/LocalLogicalTreeHelper.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 WPFTemplate 9 | { 10 | public class LocalLogicalTreeHelper 11 | { 12 | public static DependencyObject GetParent(DependencyObject dependency, Type type) 13 | { 14 | if (dependency.GetType() == typeof(Window)) 15 | { 16 | return dependency; 17 | } 18 | 19 | var parent = LogicalTreeHelper.GetParent(dependency); 20 | if (parent == null) 21 | { 22 | return dependency; 23 | } 24 | 25 | if (parent.GetType() == type) 26 | { 27 | return parent; 28 | } 29 | 30 | return GetParent(parent, type); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WPFTemplate/common/LocalVisualTreeHelper.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.Media; 9 | 10 | namespace WPFTemplate 11 | { 12 | public class LocalVisualTreeHelper 13 | { 14 | public static DependencyObject GetParent(DependencyObject dependency, Type type) 15 | { 16 | if (dependency.GetType() == typeof(Window) || dependency.GetType().IsSubclassOf(typeof(Window))) 17 | { 18 | return dependency; 19 | } 20 | 21 | var parent = VisualTreeHelper.GetParent(dependency); 22 | if (parent == null) 23 | { 24 | return dependency; 25 | } 26 | 27 | if (parent.GetType() == type || parent.GetType().IsSubclassOf(type)) 28 | { 29 | return parent; 30 | } 31 | 32 | return GetParent(parent, type); 33 | } 34 | 35 | public static void SetTemplateItemVisibility(Control control, string elementname, Visibility visibility) 36 | { 37 | var item = control.Template.FindName(elementname, control) as UIElement; 38 | if (item != null) 39 | { 40 | item.Visibility = visibility; 41 | } 42 | } 43 | 44 | public static int GetTreeViewItemLevel(TreeViewItem treeViewItem) 45 | { 46 | int level = 0; 47 | 48 | DependencyObject parent = VisualTreeHelper.GetParent(treeViewItem); 49 | while (parent != null && !(parent is TreeView)) 50 | { 51 | if (parent is TreeViewItem) 52 | { 53 | level++; 54 | } 55 | parent = VisualTreeHelper.GetParent(parent); 56 | } 57 | 58 | return level; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /WPFTemplate/common/TreeViewItemHelper.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 WPFTemplate 9 | { 10 | public class TreeViewItemHelper 11 | { 12 | public static readonly DependencyProperty HeaderHeightProperty; 13 | 14 | public static readonly DependencyProperty IconProperty; 15 | 16 | static TreeViewItemHelper() 17 | { 18 | HeaderHeightProperty = DependencyProperty.RegisterAttached("HeaderHeight", typeof(double), typeof(TreeViewItemHelper), new PropertyMetadata((double)20)); 19 | IconProperty = DependencyProperty.RegisterAttached("Icon", typeof(string), typeof(TreeViewItemHelper)); 20 | } 21 | 22 | public static string GetIcon(DependencyObject obj) 23 | { 24 | return (string)obj.GetValue(IconProperty); 25 | } 26 | public static void SetIcon(DependencyObject obj, string value) 27 | { 28 | obj.SetValue(IconProperty, value); 29 | } 30 | 31 | public static double GetHeaderHeight(DependencyObject obj) 32 | { 33 | return (double)obj.GetValue(HeaderHeightProperty); 34 | } 35 | public static void SetHeaderHeight(DependencyObject obj, double value) 36 | { 37 | obj.SetValue(HeaderHeightProperty, value); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /WPFTemplate/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /WPFTemplate/test.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /WPFTemplate/test.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 WPFTemplate 17 | { 18 | /// 19 | /// test.xaml 的交互逻辑 20 | /// 21 | public partial class test : Page 22 | { 23 | public test() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Wpf063Demo/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Wpf063Demo/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | pack://application:,,,/WPFTemplate;component/Resources/iconfont.ttf#FatSheep 11 | 12 | 13 | -------------------------------------------------------------------------------- /Wpf063Demo/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 Wpf063Demo 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Wpf063Demo/MainWindow.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 Wpf063Demo 17 | { 18 | /// 19 | /// MainWindow.xaml 的交互逻辑 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) 29 | { 30 | base.OnMouseLeftButtonDown(e); 31 | this.DragMove(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Wpf063Demo/Model/MainFunction.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 Wpf063Demo.Model 8 | { 9 | public class MainFunction 10 | { 11 | public string Image { get; set; } 12 | public string Name { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Wpf063Demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("Wpf063Demo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("Wpf063Demo")] 15 | [assembly: AssemblyCopyright("Copyright © 2024")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Wpf063Demo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Wpf063Demo.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wpf063Demo.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Wpf063Demo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Wpf063Demo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Wpf063Demo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Wpf063Demo/Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/logo.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/main.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/profile4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/profile4.jpg -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/aqdn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/aqdn.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/fhzx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/fhzx.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/mmcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/mmcs.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/qljs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/qljs.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/qsnms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/qsnms.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/rjgj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/rjgj.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/sjan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/sjan.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/tcgl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/tcgl.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/wlaq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/wlaq.png -------------------------------------------------------------------------------- /Wpf063Demo/Resources/smallpng/xtqd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/Resources/smallpng/xtqd.png -------------------------------------------------------------------------------- /Wpf063Demo/View/LoginView.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.Animation; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Shapes; 15 | 16 | namespace Wpf063Demo.View 17 | { 18 | /// 19 | /// LoginView.xaml 的交互逻辑 20 | /// 21 | public partial class LoginView : Window 22 | { 23 | public LoginView() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) 29 | { 30 | base.OnMouseLeftButtonDown(e); 31 | this.DragMove(); 32 | } 33 | 34 | private void CornerButton_Click(object sender, RoutedEventArgs e) 35 | { 36 | MainWindow mainWindow = new MainWindow(); 37 | mainWindow.Show(); 38 | this.Close(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Wpf063Demo/ViewModel/MainViewModel.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/Wpf063Demo/ViewModel/MainViewModel.cs -------------------------------------------------------------------------------- /Wpf063Demo/ViewModel/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | In App.xaml: 3 | 4 | 6 | 7 | 8 | In the View: 9 | DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}" 10 | 11 | You can also use Blend to do all this with the tool's support. 12 | See http://www.galasoft.ch/mvvm 13 | */ 14 | 15 | using CommonServiceLocator; 16 | using GalaSoft.MvvmLight; 17 | using GalaSoft.MvvmLight.Ioc; 18 | 19 | namespace Wpf063Demo.ViewModel 20 | { 21 | /// 22 | /// This class contains static references to all the view models in the 23 | /// application and provides an entry point for the bindings. 24 | /// 25 | public class ViewModelLocator 26 | { 27 | /// 28 | /// Initializes a new instance of the ViewModelLocator class. 29 | /// 30 | public ViewModelLocator() 31 | { 32 | ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); 33 | 34 | ////if (ViewModelBase.IsInDesignModeStatic) 35 | ////{ 36 | //// // Create design time view services and models 37 | //// SimpleIoc.Default.Register(); 38 | ////} 39 | ////else 40 | ////{ 41 | //// // Create run time view services and models 42 | //// SimpleIoc.Default.Register(); 43 | ////} 44 | 45 | SimpleIoc.Default.Register(); 46 | } 47 | 48 | public MainViewModel Main 49 | { 50 | get 51 | { 52 | return ServiceLocator.Current.GetInstance(); 53 | } 54 | } 55 | 56 | public static void Cleanup() 57 | { 58 | // TODO Clear the ViewModels 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Wpf063Demo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WpfBootstrap/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WpfBootstrap/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 WpfBootstrap 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WpfBootstrap/Common/Converters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Data; 8 | using System.Windows.Media.Imaging; 9 | 10 | namespace WpfBootstrap.Common 11 | { 12 | public class ImageNameToImagePathConverter : IValueConverter 13 | { 14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 15 | { 16 | string url = string.Format(@"/Resources/{0}", value.ToString()); 17 | return new BitmapImage(new Uri(url, UriKind.Relative)); 18 | } 19 | 20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | } 25 | 26 | public class BarValueWarningConverter : IValueConverter 27 | { 28 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 29 | { 30 | double t = (double)value; 31 | double x = 0; 32 | double.TryParse(parameter.ToString(), out x); 33 | return t >= x; 34 | } 35 | 36 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /WpfBootstrap/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 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 WpfBootstrap 18 | { 19 | /// 20 | /// MainWindow.xaml 的交互逻辑 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | public MainWindow() 25 | { 26 | InitializeComponent(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /WpfBootstrap/Model/CornerPaginationModel.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 WpfBootstrap.Model 8 | { 9 | public class CornerPaginationModel 10 | { 11 | public string Name { get; set; } 12 | public int Age { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WpfBootstrap/Model/Revenue.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 WpfBootstrap.Model 8 | { 9 | public class Revenue 10 | { 11 | public string Month { get; set; } 12 | public string Day { get; set; } 13 | public string Profits { get; set; } 14 | public int Value { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WpfBootstrap/Model/TreeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace WpfBootstrap.Model 4 | { 5 | public class TreeViewModel 6 | { 7 | public string Header { get; set; } 8 | public string Icon { get; set; } 9 | public ObservableCollection Children { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /WpfBootstrap/Model/UnicodeModel.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 WpfBootstrap.Model 8 | { 9 | public class UnicodeModel 10 | { 11 | public string Icon 12 | { 13 | get 14 | { 15 | if (!string.IsNullOrWhiteSpace(Code)) 16 | { 17 | var newcode = Code.Replace("&#x", "").TrimEnd(';'); 18 | int codePoint = int.Parse(newcode, System.Globalization.NumberStyles.HexNumber); 19 | string _icon = char.ConvertFromUtf32(codePoint); 20 | return _icon; 21 | } 22 | return Code; 23 | } 24 | } 25 | public string Name { get; set; } 26 | public string Code { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/Model/WorkScream.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 WpfBootstrap.Model 8 | { 9 | public class WorkScream 10 | { 11 | public string Img { get; set; } 12 | public string Content { get; set; } 13 | public string Time { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WpfBootstrap/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("WpfBootstrap")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("WpfBootstrap")] 15 | [assembly: AssemblyCopyright("Copyright © 2024")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /WpfBootstrap/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WpfBootstrap.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WpfBootstrap/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WpfBootstrap/Resources/08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/08.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/Mountain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/Mountain.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/Orange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/Orange.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/ice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/ice.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/island.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/island.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile1.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile10.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile11.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile2.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile3.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile4.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile5.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile6.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile7.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile8.jpg -------------------------------------------------------------------------------- /WpfBootstrap/Resources/profile9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfBootstrap/Resources/profile9.jpg -------------------------------------------------------------------------------- /WpfBootstrap/View/BadgeView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /WpfBootstrap/View/BadgeView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// BadgeView.xaml 的交互逻辑 20 | /// 21 | public partial class BadgeView : UserControl 22 | { 23 | public BadgeView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CardView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CardView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CardView.xaml 的交互逻辑 20 | /// 21 | public partial class CardView : UserControl 22 | { 23 | public CardView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CarouselView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CarouselView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CarouselView.xaml 的交互逻辑 19 | /// 20 | public partial class CarouselView : UserControl 21 | { 22 | public CarouselView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ChartCurveView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// ChartCurveView.xaml 的交互逻辑 20 | /// 21 | public partial class ChartCurveView : UserControl 22 | { 23 | public ChartCurveView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ChartLineView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// ChartLineView.xaml 的交互逻辑 20 | /// 21 | public partial class ChartLineView : UserControl 22 | { 23 | public ChartLineView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ChartsView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// ChartsView.xaml 的交互逻辑 20 | /// 21 | public partial class ChartsView : UserControl 22 | { 23 | public ChartsView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ColorSliderView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ColorSliderView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// ColorSliderView.xaml 的交互逻辑 19 | /// 20 | public partial class ColorSliderView : UserControl 21 | { 22 | public ColorSliderView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerButtonView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerButtonView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerButtonView : UserControl 21 | { 22 | public CornerButtonView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerCalendarView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerCalendarView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CornerCalendarView.xaml 的交互逻辑 20 | /// 21 | public partial class CornerCalendarView : UserControl 22 | { 23 | public CornerCalendarView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerCheckBoxView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerCheckBoxView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerCheckBoxView : UserControl 21 | { 22 | public CornerCheckBoxView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerComboBoxView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerComboBoxView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerComboBox.xaml 的交互逻辑 19 | /// 20 | public partial class CornerComboBoxView : UserControl 21 | { 22 | public CornerComboBoxView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerContextMenuView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerContextMenuView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerContextMenuView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerContextMenuView : UserControl 21 | { 22 | public CornerContextMenuView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerDatePickerView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerDatePickerView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CornerDatePickerView.xaml 的交互逻辑 20 | /// 21 | public partial class CornerDatePickerView : UserControl 22 | { 23 | public CornerDatePickerView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerExpanderView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CornerExpanderView.xaml 的交互逻辑 20 | /// 21 | public partial class CornerExpanderView : UserControl 22 | { 23 | public CornerExpanderView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerMultiComboBoxView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerMultiComboBoxView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerMultiComboBoxView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerMultiComboBoxView : UserControl 21 | { 22 | public CornerMultiComboBoxView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerPaginationView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerPaginationView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerPaginationView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerPaginationView : UserControl 21 | { 22 | public CornerPaginationView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerPasswordBoxView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerPasswordBoxView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerPasswordBoxView : UserControl 21 | { 22 | public CornerPasswordBoxView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerProgressBarView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerProgressBarView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerProgressBarView : UserControl 21 | { 22 | public CornerProgressBarView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerRadioButtonView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 37 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerRadioButtonView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerRadioButtonView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerRadioButtonView : UserControl 21 | { 22 | public CornerRadioButtonView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerSliderView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CornerSliderView.xaml 的交互逻辑 20 | /// 21 | public partial class CornerSliderView : UserControl 22 | { 23 | public CornerSliderView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerTabControlView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerTabControlView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerTabControlView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerTabControlView : UserControl 21 | { 22 | public CornerTabControlView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerToolTipView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerToolTipView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// CornerToolTipView.xaml 的交互逻辑 20 | /// 21 | public partial class CornerToolTipView : UserControl 22 | { 23 | public CornerToolTipView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerTreeViewView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /WpfBootstrap/View/CornerTreeViewView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// CornerTreeViewView.xaml 的交互逻辑 19 | /// 20 | public partial class CornerTreeViewView : UserControl 21 | { 22 | public CornerTreeViewView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/View/DonutView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /WpfBootstrap/View/DonutView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// DonutView.xaml 的交互逻辑 20 | /// 21 | public partial class DonutView : UserControl 22 | { 23 | public DonutView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/DrawerView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// DrawerView.xaml 的交互逻辑 20 | /// 21 | public partial class DrawerView : UserControl 22 | { 23 | public DrawerView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/HomeTableEditView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Shapes; 15 | 16 | namespace WpfBootstrap.View 17 | { 18 | /// 19 | /// HomeTableEditView.xaml 的交互逻辑 20 | /// 21 | public partial class HomeTableEditView : Window 22 | { 23 | public HomeTableEditView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/HomeView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Shapes; 16 | using WpfBootstrap.Model; 17 | 18 | namespace WpfBootstrap.View 19 | { 20 | /// 21 | /// HomeView.xaml 的交互逻辑 22 | /// 23 | public partial class HomeView : UserControl 24 | { 25 | public HomeView() 26 | { 27 | InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WpfBootstrap/View/HoverView.xaml: -------------------------------------------------------------------------------- 1 |  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 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /WpfBootstrap/View/HoverView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// HoverView.xaml 的交互逻辑 20 | /// 21 | public partial class HoverView : UserControl 22 | { 23 | public HoverView() 24 | { 25 | InitializeComponent(); 26 | gd1.MouseMove += MainGrid_MouseMove; 27 | gd1.MouseLeave += Bd1_MouseLeave; 28 | gd1.MouseEnter += Bd1_MouseEnter; 29 | } 30 | 31 | private void Bd1_MouseEnter(object sender, MouseEventArgs e) 32 | { 33 | bd2.Visibility = Visibility.Visible; 34 | } 35 | 36 | private void Bd1_MouseLeave(object sender, MouseEventArgs e) 37 | { 38 | bd2.Visibility = Visibility.Hidden; 39 | } 40 | 41 | private void MainGrid_MouseMove(object sender, MouseEventArgs e) 42 | { 43 | //这里获取一下鼠标的坐标,然后让clip效果的中心跟着鼠标中心移动 44 | Point mousePosition = e.GetPosition(gd1); 45 | eg1.Center = new Point(mousePosition.X, mousePosition.Y); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /WpfBootstrap/View/LoadingView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /WpfBootstrap/View/LoadingView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// LoadingView.xaml 的交互逻辑 20 | /// 21 | public partial class LoadingView : UserControl 22 | { 23 | public LoadingView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/NoticeBarView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /WpfBootstrap/View/NoticeBarView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// NoticeBarView.xaml 的交互逻辑 20 | /// 21 | public partial class NoticeBarView : UserControl 22 | { 23 | public NoticeBarView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/NotifyWindowView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WpfBootstrap/View/NotifyWindowView.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 | using WPFTemplate; 16 | 17 | namespace WpfBootstrap.View 18 | { 19 | /// 20 | /// NotifyWindowView.xaml 的交互逻辑 21 | /// 22 | public partial class NotifyWindowView : UserControl 23 | { 24 | readonly NotifyWindow window; 25 | 26 | public NotifyWindowView() 27 | { 28 | InitializeComponent(); 29 | window = new NotifyWindow(); 30 | 31 | Binding bd = new Binding(); 32 | bd.Source = window; 33 | bd.Path = new PropertyPath("NewMsgCount"); 34 | tbIsRead.SetBinding(TextBlock.TextProperty, bd); 35 | } 36 | 37 | private void CornerButton_Click(object sender, RoutedEventArgs e) 38 | { 39 | window.SendMessage((NotifySourceEnum)Enum.Parse(typeof(NotifySourceEnum), cbType.Text), tbMessage.Text); 40 | } 41 | 42 | private void UserControl_Loaded(object sender, RoutedEventArgs e) 43 | { 44 | window.Owner = LocalLogicalTreeHelper.GetParent(this, typeof(Window)) as Window; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /WpfBootstrap/View/PlaceControlView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 13 | 18 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /WpfBootstrap/View/PlaceControlView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// PlaceControlView.xaml 的交互逻辑 20 | /// 21 | public partial class PlaceControlView : UserControl 22 | { 23 | public PlaceControlView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/StepsView.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WpfBootstrap/View/StepsView.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 WpfBootstrap.View 17 | { 18 | /// 19 | /// StepsView.xaml 的交互逻辑 20 | /// 21 | public partial class StepsView : UserControl 22 | { 23 | public StepsView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ToastView.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WpfBootstrap/View/ToastView.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 | using WPFTemplate; 16 | 17 | namespace WpfBootstrap.View 18 | { 19 | /// 20 | /// ToastView.xaml 的交互逻辑 21 | /// 22 | public partial class ToastView : UserControl 23 | { 24 | public ToastType SelectedToastType 25 | { 26 | get { return (ToastType)GetValue(SelectedToastTypeProperty); } 27 | set { SetValue(SelectedToastTypeProperty, value); } 28 | } 29 | 30 | public static readonly DependencyProperty SelectedToastTypeProperty = 31 | DependencyProperty.Register("SelectedToastType", typeof(ToastType), typeof(ToastView), new PropertyMetadata(ToastType.Info)); 32 | 33 | public string Msg 34 | { 35 | get { return (string)GetValue(MsgProperty); } 36 | set { SetValue(MsgProperty, value); } 37 | } 38 | 39 | // Using a DependencyProperty as the backing store for Msg. This enables animation, styling, binding, etc... 40 | public static readonly DependencyProperty MsgProperty = 41 | DependencyProperty.Register("Msg", typeof(string), typeof(ToastView), new PropertyMetadata("Thank you for viewing my framework...")); 42 | 43 | public ToastView() 44 | { 45 | InitializeComponent(); 46 | } 47 | 48 | private void CornerButton_Click(object sender, RoutedEventArgs e) 49 | { 50 | Toast.Show(Msg, SelectedToastType); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /WpfBootstrap/View/UnicodeView.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.Shapes; 14 | 15 | namespace WpfBootstrap.View 16 | { 17 | /// 18 | /// UnicodeView.xaml 的交互逻辑 19 | /// 20 | public partial class UnicodeView : UserControl 21 | { 22 | public UnicodeView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WpfBootstrap/ViewModel/CornerPaginationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using WPFTemplate; 8 | 9 | namespace WpfBootstrap.ViewModel 10 | { 11 | public class CornerPaginationViewModel : ViewModelBase 12 | { 13 | private DataTable _human; 14 | 15 | public DataTable Human 16 | { 17 | get 18 | { 19 | if (_human == null) 20 | { 21 | _human = new DataTable(); 22 | _human.Columns.Add("Name", typeof(string)); 23 | _human.Columns.Add("Age", typeof(int)); 24 | } 25 | return _human; 26 | } 27 | } 28 | public CornerPaginationViewModel() 29 | { 30 | for (int i = 0; i < 200; i++) 31 | { 32 | Human.Rows.Add($"张三{i}", i); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /WpfBootstrap/ViewModel/TreeViewViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using WpfBootstrap.Model; 8 | using WPFTemplate; 9 | 10 | namespace WpfBootstrap.ViewModel 11 | { 12 | public class TreeViewViewModel : ViewModelBase 13 | { 14 | public ObservableCollection TreeViewModels { get; set; } 15 | 16 | public TreeViewViewModel() 17 | { 18 | TreeViewModels = new ObservableCollection() 19 | { 20 | new TreeViewModel 21 | { 22 | Header ="First", 23 | Children = new ObservableCollection 24 | { 25 | new TreeViewModel 26 | { 27 | Header = "First-Child", 28 | Children= new ObservableCollection 29 | { 30 | new TreeViewModel 31 | { 32 | Header= "First-Grandchild" 33 | } 34 | } 35 | } 36 | } 37 | }, 38 | new TreeViewModel 39 | { 40 | Header ="Second", 41 | Children = new ObservableCollection 42 | { 43 | new TreeViewModel 44 | { 45 | Header = "Second-Child", 46 | Children = new ObservableCollection 47 | { 48 | new TreeViewModel 49 | { 50 | Header= "Second-Grandchild" 51 | } 52 | } 53 | } 54 | } 55 | }, 56 | new TreeViewModel 57 | { 58 | Header ="Third", 59 | Children = new ObservableCollection 60 | { 61 | new TreeViewModel 62 | { 63 | Header = "Third-Child", 64 | Children = new ObservableCollection 65 | { 66 | new TreeViewModel 67 | { 68 | Header= "Third-Grandchild" 69 | } 70 | } 71 | } 72 | } 73 | } 74 | }; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /WpfBootstrap/ViewModelFactory/VmFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using WpfBootstrap.ViewModel; 7 | using WPFTemplate; 8 | 9 | namespace WpfBootstrap 10 | { 11 | public class VmFactory 12 | { 13 | public MainViewModel Main 14 | { 15 | get 16 | { 17 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 18 | } 19 | } 20 | 21 | public UnicodeViewModel Unicode 22 | { 23 | get 24 | { 25 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 26 | } 27 | } 28 | 29 | public TreeViewViewModel TreeView 30 | { 31 | get 32 | { 33 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 34 | } 35 | } 36 | 37 | public CornerPaginationViewModel Pagination 38 | { 39 | get 40 | { 41 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 42 | } 43 | } 44 | 45 | public HomeViewModel Home 46 | { 47 | get 48 | { 49 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /WpfQQDemo/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WpfQQDemo/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WpfQQDemo/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 WpfQQDemo 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WpfQQDemo/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 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 WpfQQDemo 18 | { 19 | /// 20 | /// MainWindow.xaml 的交互逻辑 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | public MainWindow() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) 30 | { 31 | base.OnMouseLeftButtonDown(e); 32 | this.DragMove(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WpfQQDemo/Model/GroupUser.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 WpfQQDemo 8 | { 9 | public class GroupUser 10 | { 11 | public int GroupId { get; set; } 12 | public string GroupName { get; set; } 13 | public string Time { get; set; } 14 | public string Image { get; set; } 15 | public List Users { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WpfQQDemo/Model/QQGroup.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.Media.Imaging; 7 | 8 | namespace WpfQQDemo 9 | { 10 | public class QQGroup 11 | { 12 | public int GroupId { get; set; } 13 | public string GroupName { get; set; } 14 | public string Time { get; set; } 15 | public string Image { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WpfQQDemo/Model/QQMessage.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 WpfQQDemo 8 | { 9 | public class QQMessage 10 | { 11 | public string UserName { get; set; } 12 | public string Profile { get; set; } 13 | public string Time { get; set; } 14 | public string Message { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WpfQQDemo/Model/QQRelation.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 WpfQQDemo 8 | { 9 | public class QQRelation 10 | { 11 | public int GroupId { get; set; } 12 | public int UserId { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /WpfQQDemo/Model/QQUser.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 WpfQQDemo 8 | { 9 | public class QQUser 10 | { 11 | public int UserId { get; set; } 12 | public string UserName { get; set; } 13 | public string Profile { get; set; } 14 | public Role Role { get; set; } 15 | } 16 | 17 | public enum Role 18 | { 19 | Leader, 20 | Manager, 21 | Customer 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /WpfQQDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("WpfQQDemo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("WpfQQDemo")] 15 | [assembly: AssemblyCopyright("Copyright © 2024")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /WpfQQDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WpfQQDemo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WpfQQDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WpfQQDemo/Resources/profile5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfQQDemo/Resources/profile5.jpg -------------------------------------------------------------------------------- /WpfQQDemo/Resources/profile6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfQQDemo/Resources/profile6.jpg -------------------------------------------------------------------------------- /WpfQQDemo/Resources/profile7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfQQDemo/Resources/profile7.jpg -------------------------------------------------------------------------------- /WpfQQDemo/Resources/profile8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfQQDemo/Resources/profile8.jpg -------------------------------------------------------------------------------- /WpfQQDemo/Resources/profile9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bearhanQ/WPFFramework/5a20c751546953f6921777708800eb96d7823a3e/WpfQQDemo/Resources/profile9.jpg -------------------------------------------------------------------------------- /WpfQQDemo/ViewModel/QQViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Media.Imaging; 8 | using WPFTemplate; 9 | 10 | namespace WpfQQDemo 11 | { 12 | public class QQViewModel : ViewModelBase 13 | { 14 | public ObservableCollection GroupUsers { get; set; } 15 | 16 | public ObservableCollection QQMessages { get; set; } 17 | 18 | public CommandBase SendMessage { get; set; } 19 | 20 | public QQViewModel() 21 | { 22 | var list = Db.Groups.Select(g => 23 | new GroupUser 24 | { 25 | GroupId = g.GroupId, 26 | GroupName = g.GroupName, 27 | Image = g.Image, 28 | Time = g.Time, 29 | Users = Db.Users.Join(Db.Relations, u => u.UserId, gu => gu.UserId, (u, gu) => 30 | new { User = u, GroupId = gu.GroupId }).Where(x => x.GroupId == g.GroupId).Select(x => x.User).ToList() 31 | }).ToList(); 32 | 33 | GroupUsers = new ObservableCollection(list); 34 | 35 | QQMessages = new ObservableCollection(); 36 | 37 | SendMessage = new CommandBase(SendAction, CanSend); 38 | } 39 | 40 | private void SendAction(object parameter) 41 | { 42 | var textBox = parameter as CornerTextBox; 43 | QQMessage item = new QQMessage(); 44 | item.Profile = "pack://application:,,,/WpfQQDemo;component/Resources/profile5.jpg"; 45 | item.UserName = "曹操"; 46 | item.Time = DateTime.Now.ToString("HH:mm:ss"); 47 | item.Message = textBox.Text; 48 | QQMessages.Add(item); 49 | textBox.Clear(); 50 | } 51 | 52 | private bool CanSend(object parameter) 53 | { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /WpfQQDemo/VmFactory.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 WpfQQDemo 8 | { 9 | public class VmFactory 10 | { 11 | public QQViewModel Main 12 | { 13 | get 14 | { 15 | return WPFTemplate.ViewModelFactory.Instance.CreateInstance(); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /WpfQQDemo/WpfQQDemo.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | --------------------------------------------------------------------------------