Showing preview only (3,459K chars total). Download the full file or copy to clipboard to get everything.
Repository: Ruris/PanuonUI
Branch: master
Commit: 6a28a8f41551
Files: 234
Total size: 3.2 MB
Directory structure:
gitextract_d18lroo2/
├── .gitignore
├── LICENSE
├── Panuon.UI/
│ ├── 0_Base/
│ │ ├── DragableThumb.cs
│ │ ├── NotTopMostPopup.cs
│ │ ├── PUResizeContainer.cs
│ │ ├── PUResizeGrid.cs
│ │ ├── PUResizeThumb.cs
│ │ └── PUWindow.cs
│ ├── 2_Button/
│ │ ├── PUButton.cs
│ │ └── PURepeatButton.cs
│ ├── 3_TextBox/
│ │ └── PUTextBox.cs
│ ├── 4_PasswordBox/
│ │ └── PUPasswordBox.cs
│ ├── 5_ComboBox/
│ │ ├── PUComboBox.cs
│ │ └── PUComboBoxItem.cs
│ ├── 6_CheckBox/
│ │ └── PUCheckBox.cs
│ ├── 7_RadioButton/
│ │ └── PURadioButton.cs
│ ├── 8_ProgressBar/
│ │ └── PUProgressBar.cs
│ ├── 9_Special/
│ │ ├── Countdown.cs
│ │ ├── DateTimePicker.cs
│ │ ├── DropDown.cs
│ │ ├── PUCard.cs
│ │ ├── PUImageCuter.xaml
│ │ ├── PUImageCuter.xaml.cs
│ │ ├── PUIndicator.xaml
│ │ ├── PUIndicator.xaml.cs
│ │ ├── PULoading.xaml
│ │ ├── PULoading.xaml.cs
│ │ ├── PUMessageBox.xaml
│ │ ├── PUMessageBox.xaml.cs
│ │ ├── PUSlideShow.xaml
│ │ ├── PUSlideShow.xaml.cs
│ │ └── PUSplitLine.cs
│ ├── A0_TreeView/
│ │ ├── PUTreeView.cs
│ │ └── PUTreeViewItem.cs
│ ├── A1_Slider/
│ │ ├── PUSlider.xaml
│ │ └── PUSlider.xaml.cs
│ ├── A2_TabControl/
│ │ ├── PUTabControl.cs
│ │ └── PUTabItem.cs
│ ├── A3_ListBox/
│ │ ├── PUListBox.cs
│ │ └── PUListBoxItem.cs
│ ├── A4_DatePicker/
│ │ ├── PUDatePicker.xaml
│ │ └── PUDatePicker.xaml.cs
│ ├── A5_PagingNav/
│ │ ├── PUPagingNav.xaml
│ │ └── PUPagingNav.xaml.cs
│ ├── A6_ContextMenu/
│ │ ├── PUContextMenu.cs
│ │ └── PUContextMenuItem.cs
│ ├── A7_Bubble/
│ │ └── PUBubble.cs
│ ├── Helper/
│ │ └── Helper.cs
│ ├── Others/
│ │ └── Enums.cs
│ ├── Panuon.UI.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Themes/
│ │ ├── Control.xaml
│ │ ├── Generic.xaml
│ │ └── Resources.xaml
│ ├── Utils/
│ │ ├── Converters.cs
│ │ ├── Extends.cs
│ │ └── Utils.cs
│ ├── Z_Helper/
│ │ └── Helper.cs
│ ├── Z_Models/
│ │ ├── PUComboBoxItemModel.cs
│ │ ├── PUListBoxItemModel.cs
│ │ ├── PUTabItemModel.cs
│ │ └── PUTreeViewItemModel.cs
│ ├── Z_Others/
│ │ ├── Converters.cs
│ │ ├── Enums.cs
│ │ └── SkipCompareAttribute.cs
│ └── Z_Utils/
│ ├── Extends.cs
│ └── Utils.cs
├── Panuon.UI.Charts/
│ ├── 0_Base/
│ │ ├── PUChartPoint.cs
│ │ ├── PUChartToolTip.xaml
│ │ └── PUChartToolTip.xaml.cs
│ ├── 1_LineChart/
│ │ ├── PULineChart.cs
│ │ ├── PULineChart.xaml
│ │ └── PULineChart.xaml.cs
│ ├── Others/
│ │ └── Enums.cs
│ ├── Panuon.UI.Charts.csproj
│ └── Properties/
│ └── AssemblyInfo.cs
├── Panuon.UI.sln
├── Panuon.UIBrowser/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppBootstrapper.cs
│ ├── IShell.cs
│ ├── Models/
│ │ └── DataSourceModel.cs
│ ├── Panuon.UIBrowser.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── ViewModels/
│ │ ├── Chart/
│ │ │ └── LineChartViewModel.cs
│ │ ├── Control/
│ │ │ ├── ButtonViewModel.cs
│ │ │ ├── CheckBoxViewModel.cs
│ │ │ ├── ComboBoxViewModel.cs
│ │ │ ├── ContextMenuViewModel.cs
│ │ │ ├── DatePickerViewModel.cs
│ │ │ ├── ListBoxViewModel.cs
│ │ │ ├── PasswordBoxViewModel.cs
│ │ │ ├── ProgressBarViewModel.cs
│ │ │ ├── RadioButtonViewModel.cs
│ │ │ ├── SliderViewModel.cs
│ │ │ ├── TabControlViewModel.cs
│ │ │ ├── TextBoxViewModel.cs
│ │ │ ├── TreeViewViewModel.cs
│ │ │ └── WindowViewModel.cs
│ │ ├── Example.cs
│ │ ├── IntroductionViewModel.cs
│ │ ├── MainWindowViewModel.cs
│ │ ├── OverviewViewModel.cs
│ │ ├── Partial/
│ │ │ ├── BubblesViewModel.cs
│ │ │ ├── ButtonsViewModel.cs
│ │ │ ├── CheckBoxsViewModel.cs
│ │ │ ├── ComboBoxsViewModel.cs
│ │ │ ├── ContextMenusViewModel.cs
│ │ │ ├── DataGridsViewModel.cs
│ │ │ ├── DatePickersViewModel.cs
│ │ │ ├── GridsViewModel.cs
│ │ │ ├── ImageCuterViewModel.cs
│ │ │ ├── IntroductionViewModel.cs
│ │ │ ├── LineChartsViewModel.cs
│ │ │ ├── ListBoxsViewModel.cs
│ │ │ ├── PagingNavsViewModel.cs
│ │ │ ├── PasswordBoxsViewModel.cs
│ │ │ ├── ProgressBarsViewModel.cs
│ │ │ ├── RadioButtonsViewModel.cs
│ │ │ ├── SlidersViewModel.cs
│ │ │ ├── SpecialViewModel.cs
│ │ │ ├── TabControlsViewModel.cs
│ │ │ ├── TextBoxsViewModel.cs
│ │ │ ├── TreeViewsViewModel.cs
│ │ │ ├── UtilsViewModel.cs
│ │ │ └── WindowsViewModel.cs
│ │ ├── ShellWindowViewModel.cs
│ │ └── Special/
│ │ ├── BubbleViewModel.cs
│ │ ├── DropDownViewModel.cs
│ │ ├── ImageCuterViewModel.cs
│ │ ├── LoadingViewModel.cs
│ │ ├── PagingNavViewModel.cs
│ │ ├── ResizeGridViewModel.cs
│ │ └── SplitLineViewModel.cs
│ ├── Views/
│ │ ├── Chart/
│ │ │ └── LineChartView.xaml
│ │ ├── Controls/
│ │ │ ├── ButtonView.xaml
│ │ │ ├── CheckBoxView.xaml
│ │ │ ├── ComboBoxView.xaml
│ │ │ ├── ContextMenuView.xaml
│ │ │ ├── DatePickerView.xaml
│ │ │ ├── Examples/
│ │ │ │ ├── ChatWindow.xaml
│ │ │ │ ├── ChatWindow.xaml.cs
│ │ │ │ ├── LoginWindow.xaml
│ │ │ │ ├── LoginWindow.xaml.cs
│ │ │ │ ├── MultiNavWindow.xaml
│ │ │ │ └── MultiNavWindow.xaml.cs
│ │ │ ├── ListBoxView.xaml
│ │ │ ├── PasswordBoxView.xaml
│ │ │ ├── ProgressBarView.xaml
│ │ │ ├── RadioButtonView.xaml
│ │ │ ├── SliderView.xaml
│ │ │ ├── TabControlView.xaml
│ │ │ ├── TextBoxView.xaml
│ │ │ ├── TreeViewView.xaml
│ │ │ └── WindowView.xaml
│ │ ├── MainWindowView.xaml
│ │ ├── OverviewView.xaml
│ │ ├── Partial/
│ │ │ ├── BubblesView.xaml
│ │ │ ├── ButtonsView.xaml
│ │ │ ├── CheckBoxsView.xaml
│ │ │ ├── ComboBoxsView.xaml
│ │ │ ├── ContextMenusView.xaml
│ │ │ ├── DataGridsView.xaml
│ │ │ ├── DatePickersView.xaml
│ │ │ ├── HelpersView.xaml
│ │ │ ├── ImageCuterView.xaml
│ │ │ ├── IntroductionView.xaml
│ │ │ ├── LineChartsView.xaml
│ │ │ ├── ListBoxsView.xaml
│ │ │ ├── PagingNavsView.xaml
│ │ │ ├── PasswordBoxsView.xaml
│ │ │ ├── ProgressBarsView.xaml
│ │ │ ├── RadioButtonsView.xaml
│ │ │ ├── SlidersView.xaml
│ │ │ ├── SpecialView.xaml
│ │ │ ├── TabControlsView.xaml
│ │ │ ├── TextBoxsView.xaml
│ │ │ ├── TreeViewsView.xaml
│ │ │ ├── UtilsView.xaml
│ │ │ └── WindowsView.xaml
│ │ ├── ShellWindowView.xaml
│ │ └── Special/
│ │ ├── BubbleView.xaml
│ │ ├── DropDownView.xaml
│ │ ├── ImageCuterView.xaml
│ │ ├── IndicatorView.xaml
│ │ ├── LoadingView.xaml
│ │ ├── PagingNavView.xaml
│ │ ├── ResizeGridView.xaml
│ │ └── SplitLineView.xaml
│ ├── app.config
│ └── packages.config
├── README.md
└── packages/
├── Caliburn.Micro.3.2.0/
│ ├── Caliburn.Micro.3.2.0.nupkg
│ └── lib/
│ ├── MonoAndroid10/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ ├── MonoTouch10/
│ │ ├── Caliburn.Micro.Platform.Core.dll.mdb
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── Caliburn.Micro.dll.mdb
│ ├── Xamarin.iOS10/
│ │ ├── Caliburn.Micro.Platform.Core.dll.mdb
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── Caliburn.Micro.dll.mdb
│ ├── net40/
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── System.Windows.Interactivity.xml
│ ├── net45/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ ├── sl5/
│ │ └── Caliburn.Micro.Platform.xml
│ ├── uap10.0/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.UWP/
│ │ │ └── Properties/
│ │ │ └── Caliburn.Micro.Platform.UWP.rd.xml
│ │ ├── Caliburn.Micro.Platform.UWP.XML
│ │ └── Caliburn.Micro.Platform.UWP.pri
│ ├── win81/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.XML
│ │ └── Caliburn.Micro.Platform.pri
│ ├── wp8/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ └── wpa81/
│ ├── Caliburn.Micro.Platform.Core.xml
│ ├── Caliburn.Micro.Platform.pri
│ └── Caliburn.Micro.Platform.xml
└── Caliburn.Micro.Core.3.2.0/
├── Caliburn.Micro.Core.3.2.0.nupkg
└── lib/
├── net40/
│ └── Caliburn.Micro.XML
├── net45/
│ └── Caliburn.Micro.xml
├── portable-net45+win8+wp8+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10+uap10.0/
│ ├── Caliburn.Micro.XML
│ └── Caliburn.Micro.dll.mdb
└── sl5/
└── Caliburn.Micro.XML
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.suo
*.user
*.userosscache
*.sln.docstates
*.userprefs
*.pdb
*.dll
*.cache
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
.vs/
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: Panuon.UI/0_Base/DragableThumb.cs
================================================
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
using System.Windows.Media;
namespace Panuon.UI
{
internal class DragableThumb : Thumb
{
static DragableThumb()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DragableThumb), new FrameworkPropertyMetadata(typeof(DragableThumb)));
}
public DragableThumb()
{
DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDelta);
}
private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
var element = DragTarget as FrameworkElement;
if (double.IsNaN(Canvas.GetLeft(element)))
Canvas.SetLeft(element, 0);
if (double.IsNaN(Canvas.GetTop(element)))
Canvas.SetTop(element, 0);
var width = element.ActualWidth;
var height = element.ActualHeight;
var left = Canvas.GetLeft(element);
var targetLeft = left + e.HorizontalChange;
var top = Canvas.GetTop(element);
var targetTop = top + e.VerticalChange;
var parentCanvas = element.Parent as Canvas;
if (LimitInParent && parentCanvas != null)
{
if (targetLeft < 0)
targetLeft = 0;
else if (targetLeft + width > parentCanvas.ActualWidth)
targetLeft = parentCanvas.ActualWidth - width;
if (targetTop < 0)
targetTop = 0;
else if (targetTop + height > parentCanvas.ActualHeight)
targetTop = parentCanvas.ActualHeight - height;
}
Canvas.SetLeft(element, targetLeft);
Canvas.SetTop(element, targetTop);
}
#region Property
public DependencyObject DragTarget
{
get { return (DependencyObject)GetValue(DragTargetProperty); }
set { SetValue(DragTargetProperty, value); }
}
public static readonly DependencyProperty DragTargetProperty =
DependencyProperty.Register("DragTarget", typeof(DependencyObject), typeof(DragableThumb));
public bool LimitInParent
{
get { return (bool)GetValue(LimitInParentProperty); }
set { SetValue(LimitInParentProperty, value); }
}
public static readonly DependencyProperty LimitInParentProperty =
DependencyProperty.Register("LimitInParent", typeof(bool), typeof(DragableThumb));
#endregion
}
}
================================================
FILE: Panuon.UI/0_Base/NotTopMostPopup.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Interop;
namespace Panuon.UI
{
internal class NotTopMostPopup : Popup
{
private Window _window;
protected override void OnOpened(EventArgs e)
{
var hwnd = ((HwndSource)PresentationSource.FromVisual(this.Child)).Handle;
RECT rect;
if (GetWindowRect(hwnd, out rect))
{
SetWindowPos(hwnd, -2, rect.Left, rect.Top, (int)this.Width, (int)this.Height, 0);
}
_window = Window.GetWindow(this);
_window.PreviewMouseDown -= Window_PreviewMouseDown;
_window.PreviewMouseDown += Window_PreviewMouseDown;
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
_window.PreviewMouseDown -= Window_PreviewMouseDown;
}
private void Window_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
var element = Tag as FrameworkElement;
if (!IsMouseOver && !element.IsMouseOver)
IsOpen = false;
}
#region P/Invoke imports & definitions
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport("user32", EntryPoint = "SetWindowPos")]
private static extern int SetWindowPos(IntPtr hWnd, int hwndInsertAfter, int x, int y, int cx, int cy, int wFlags);
#endregion
}
}
================================================
FILE: Panuon.UI/0_Base/PUResizeContainer.cs
================================================
using System.Windows;
using System.Windows.Controls;
namespace Panuon.UI
{
internal class PUResizeContainer : ContentControl
{
static PUResizeContainer()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUResizeContainer), new FrameworkPropertyMetadata(typeof(PUResizeContainer)));
}
#region Property
public bool IsSquare
{
get { return (bool)GetValue(IsSquareProperty); }
set { SetValue(IsSquareProperty, value); }
}
public static readonly DependencyProperty IsSquareProperty =
DependencyProperty.Register("IsSquare", typeof(bool), typeof(PUResizeContainer));
public bool LimitInParent
{
get { return (bool)GetValue(LimitInParentProperty); }
set { SetValue(LimitInParentProperty, value); }
}
public static readonly DependencyProperty LimitInParentProperty =
DependencyProperty.Register("LimitInParent", typeof(bool), typeof(PUResizeContainer));
public bool CanResize
{
get { return (bool)GetValue(CanResizeProperty); }
set { SetValue(CanResizeProperty, value); }
}
public static readonly DependencyProperty CanResizeProperty =
DependencyProperty.Register("CanResize", typeof(bool), typeof(PUResizeContainer), new PropertyMetadata(true));
#endregion
}
}
================================================
FILE: Panuon.UI/0_Base/PUResizeGrid.cs
================================================
using System.Windows;
using System.Windows.Controls;
namespace Panuon.UI
{
public class PUResizeGrid : UserControl
{
static PUResizeGrid()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUResizeGrid), new FrameworkPropertyMetadata(typeof(PUResizeGrid)));
}
#region Property
public bool IsSquare
{
get { return (bool)GetValue(IsSquareProperty); }
set { SetValue(IsSquareProperty, value); }
}
public static readonly DependencyProperty IsSquareProperty =
DependencyProperty.Register("IsSquare", typeof(bool), typeof(PUResizeGrid), new PropertyMetadata(false));
#endregion
}
}
================================================
FILE: Panuon.UI/0_Base/PUResizeThumb.cs
================================================
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
namespace Panuon.UI
{
internal class ResizeThumb : Thumb
{
public ResizeThumb()
{
DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDelta);
}
#region Property
public bool IsSquare
{
get { return (bool)GetValue(IsSquareProperty); }
set { SetValue(IsSquareProperty, value); }
}
public static readonly DependencyProperty IsSquareProperty =
DependencyProperty.Register("IsSquare", typeof(bool), typeof(ResizeThumb));
public bool LimitInParent
{
get { return (bool)GetValue(LimitInParentProperty); }
set { SetValue(LimitInParentProperty, value); }
}
public static readonly DependencyProperty LimitInParentProperty =
DependencyProperty.Register("LimitInParent", typeof(bool), typeof(ResizeThumb));
#endregion
#region Event
private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
{
var element = this.DataContext as FrameworkElement;
if (double.IsNaN(Canvas.GetLeft(element)))
Canvas.SetLeft(element, 0);
if (double.IsNaN(Canvas.GetTop(element)))
Canvas.SetTop(element, 0);
var parentCanvas = element.Parent as Canvas;
double width = 0.0;
double height = 0.0;
var left = Canvas.GetLeft(element);
var top = Canvas.GetTop(element);
if (HorizontalAlignment == HorizontalAlignment.Left || HorizontalAlignment == HorizontalAlignment.Right)
{
if (HorizontalAlignment == HorizontalAlignment.Left)
{
width = element.ActualWidth - e.HorizontalChange;
if (LimitInParent && parentCanvas != null)
{
if (left + e.HorizontalChange < 0 && element.ActualWidth != element.MaxWidth)
width = element.ActualWidth + left;
}
}
else
{
width = element.ActualWidth + e.HorizontalChange;
if (LimitInParent && parentCanvas != null)
{
if (left + element.ActualWidth + e.HorizontalChange > parentCanvas.ActualWidth && element.ActualWidth != element.MaxWidth)
width = parentCanvas.ActualWidth - left;
}
}
width = width > element.MaxWidth ? element.MaxWidth : width;
width = width < element.MinWidth ? element.MinWidth : width;
}
if (VerticalAlignment == VerticalAlignment.Top || VerticalAlignment == VerticalAlignment.Bottom)
{
if (VerticalAlignment == VerticalAlignment.Top)
{
height = element.ActualHeight - e.VerticalChange;
if (LimitInParent && parentCanvas != null)
{
if (top + e.VerticalChange < 0 && element.ActualHeight != element.MaxHeight)
height = element.ActualHeight + top;
}
}
else
{
height = element.ActualHeight + e.VerticalChange;
if (LimitInParent && parentCanvas != null)
{
if (top + element.ActualHeight + e.VerticalChange > parentCanvas.ActualHeight && element.ActualHeight != element.MaxHeight)
height = parentCanvas.ActualHeight - top;
}
}
height = height > element.MaxHeight ? element.MaxHeight : height;
height = height < element.MinHeight ? element.MinHeight : height;
}
if (!IsSquare)
{
if (width != 0)
SetElementWidth(element, width, left);
if (height != 0)
SetElementHeight(element, height, top);
}
else
{
if (width != 0)
{
if (!LimitInParent)
{
SetElementWidth(element, width, left);
SetElementHeight(element, width, top);
}
if (LimitInParent)
{
if (width + top < parentCanvas.ActualHeight)
{
SetElementWidth(element, width, left);
SetElementHeight(element, width, top);
}
}
}
else if (height != 0)
{
if (!LimitInParent)
{
SetElementWidth(element, height, left);
SetElementHeight(element, height, top);
}
if (LimitInParent)
{
if (height + left <= parentCanvas.ActualWidth)
{
SetElementWidth(element, height, left);
SetElementHeight(element, height, top);
}
}
}
}
}
#endregion
#region Function
private void SetElementWidth(FrameworkElement element, double width, double left)
{
if (HorizontalAlignment == HorizontalAlignment.Left)
{
var delta = element.ActualWidth - width;
Canvas.SetLeft(element, left + delta);
}
element.Width = width;
}
private void SetElementHeight(FrameworkElement element, double height, double top)
{
if (VerticalAlignment == VerticalAlignment.Top)
{
var delta = element.ActualHeight - height;
Canvas.SetTop(element, Canvas.GetTop(element) + delta);
}
element.Height = height;
}
#endregion
}
}
================================================
FILE: Panuon.UI/0_Base/PUWindow.cs
================================================
using System;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace Panuon.UI
{
public class PUWindow : Window
{
#region Import
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
#endregion
#region Identify
private enum ResizeDirection
{
Left = 1,
Right = 2,
Top = 3,
TopLeft = 4,
TopRight = 5,
Bottom = 6,
BottomLeft = 7,
BottomRight = 8,
}
private HwndSource _hwndSource;
private PUButton _btnClose;
private StackPanel _stkNav;
private bool _animateOutHandle = true;
private bool? _dialogResult;
private bool _needToSetDialogResult;
#endregion
#region Constructor
static PUWindow()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUWindow), new FrameworkPropertyMetadata(typeof(PUWindow)));
}
/// <summary>
/// 初始化一个窗体实例。
/// 若您期望从当前窗体中连续Show出多个窗体,请务必分别指定这些子窗体的Owner,否则将出现显示问题。
/// </summary>
public PUWindow()
{
PreviewMouseMove += OnPreviewMouseMove;
}
#endregion
#region Sys
public override void OnApplyTemplate()
{
var auto = Owner;
Loaded += delegate
{
if (AllowAutoCoverMask && (Owner as PUWindow) != null)
{
(Owner as PUWindow).IsCoverMaskShow = true;
}
if (AnimateIn)
OnBeginLoadStoryboard();
else
OnSkipLoadStoryboard();
if (!AllowForcingClose)
{
DisableAltF4(this);
}
};
var grdResize = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 1) as Grid;
if (grdResize != null)
{
foreach (Rectangle resizeRectangle in grdResize.Children)
{
resizeRectangle.PreviewMouseDown += ResizeRectangle_PreviewMouseDown;
resizeRectangle.MouseMove += ResizeRectangle_MouseMove;
}
}
var grdNavbar = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 0), 0), 0), 0) as Grid;
_stkNav = VisualTreeHelper.GetChild(grdNavbar, 1) as StackPanel;
grdNavbar.MouseLeftButtonDown += delegate
{
this.DragMove();
};
_btnClose = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(grdNavbar, 1), 2) as PUButton;
}
protected override void OnClosing(CancelEventArgs e)
{
if(_animateOutHandle)
base.OnClosing(e);
if (e.Cancel)
return;
if (AllowAutoCoverMask && (Owner as PUWindow) != null)
{
var owner = Owner as PUWindow;
if (owner.OwnedWindows.Count == 1)
{
owner.IsCoverMaskShow = false;
}
else
{
var closeMask = true;
foreach (var window in owner.OwnedWindows)
{
var puwindow = window as PUWindow;
if (puwindow != null)
{
if (puwindow.AllowAutoCoverMask)
{
closeMask = true;
break;
}
}
}
if (closeMask)
owner.IsCoverMaskShow = false;
}
}
if (AnimateOut && _animateOutHandle)
{
if (IsModal(this))
{
_dialogResult = DialogResult;
_needToSetDialogResult = true;
}
OnBeginCloseStoryboard();
_animateOutHandle = false;
DispatcherTimer timer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(0.4) };
timer.Tick += delegate { Close(); timer.Stop(); };
timer.Start();
e.Cancel = true;
return;
}
if (AnimateOut)
{
if (_needToSetDialogResult)
{
DialogResult = _dialogResult;
}
}
}
private void ResizeRectangle_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
Rectangle rectangle = sender as Rectangle;
if (rectangle != null)
{
switch (rectangle.Name)
{
case "Top":
Cursor = Cursors.SizeNS;
ResizeWindow(ResizeDirection.Top);
break;
case "Bottom":
Cursor = Cursors.SizeNS;
ResizeWindow(ResizeDirection.Bottom);
break;
case "Left":
Cursor = Cursors.SizeWE;
ResizeWindow(ResizeDirection.Left);
break;
case "Right":
Cursor = Cursors.SizeWE;
ResizeWindow(ResizeDirection.Right);
break;
case "TopLeft":
Cursor = Cursors.SizeNWSE;
ResizeWindow(ResizeDirection.TopLeft);
break;
case "TopRight":
Cursor = Cursors.SizeNESW;
ResizeWindow(ResizeDirection.TopRight);
break;
case "BottomLeft":
Cursor = Cursors.SizeNESW;
ResizeWindow(ResizeDirection.BottomLeft);
break;
case "BottomRight":
Cursor = Cursors.SizeNWSE;
ResizeWindow(ResizeDirection.BottomRight);
break;
default:
break;
}
}
}
private void ResizeWindow(ResizeDirection direction)
{
SendMessage(_hwndSource.Handle, 0x112, (IntPtr)(61440 + direction), IntPtr.Zero);
}
protected override void OnInitialized(EventArgs e)
{
SourceInitialized += MainWindow_SourceInitialized;
base.OnInitialized(e);
}
private void MainWindow_SourceInitialized(object sender, EventArgs e)
{
_hwndSource = (HwndSource)PresentationSource.FromVisual(this);
}
protected void OnPreviewMouseMove(object sender, MouseEventArgs e)
{
if (ResizeMode != ResizeMode.CanResize)
return;
if (Mouse.LeftButton != MouseButtonState.Pressed)
Cursor = Cursors.Arrow;
}
private void ResizeRectangle_MouseMove(object sender, MouseEventArgs e)
{
Rectangle rectangle = sender as Rectangle;
if (rectangle != null)
{
switch (rectangle.Name)
{
case "Top":
Cursor = Cursors.SizeNS;
break;
case "Bottom":
Cursor = Cursors.SizeNS;
break;
case "Left":
Cursor = Cursors.SizeWE;
break;
case "Right":
Cursor = Cursors.SizeWE;
break;
case "TopLeft":
Cursor = Cursors.SizeNWSE;
break;
case "TopRight":
Cursor = Cursors.SizeNESW;
break;
case "BottomLeft":
Cursor = Cursors.SizeNESW;
break;
case "BottomRight":
Cursor = Cursors.SizeNWSE;
break;
default:
break;
}
}
}
/// <summary>
/// Alt + F4 无效化处理
/// </summary>
private static Action DisableAltF4(Window window)
{
var source = HwndSource.FromHwnd(new WindowInteropHelper(window).Handle);
source.AddHook(DisableAltF4WndHookProc);
return () => source.RemoveHook(DisableAltF4WndHookProc);
}
/// <summary>
/// Alt + F4无效化窗口消息
/// </summary>
private static IntPtr DisableAltF4WndHookProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
const int WM_SYSKEYDOWN = 0x0104;
const int VK_F4 = 0x73;
if (msg == WM_SYSKEYDOWN && wParam.ToInt32() == VK_F4)
{
handled = true;
}
return IntPtr.Zero;
}
#endregion
#region RoutedEvent
/// <summary>
/// 使用动画打开窗体。
/// </summary>
internal static readonly RoutedEvent BeginLoadStoryboardEvent = EventManager.RegisterRoutedEvent("BeginLoadStoryboard", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUWindow>), typeof(PUWindow));
internal event RoutedPropertyChangedEventHandler<PUWindow> BeginLoadStoryboard
{
add { AddHandler(BeginLoadStoryboardEvent, value); }
remove { RemoveHandler(BeginLoadStoryboardEvent, value); }
}
internal void OnBeginLoadStoryboard()
{
RoutedPropertyChangedEventArgs<PUWindow> arg = new RoutedPropertyChangedEventArgs<PUWindow>(null, this, BeginLoadStoryboardEvent);
RaiseEvent(arg);
}
/// <summary>
/// 不使用动画打开窗体。
/// </summary>
internal static readonly RoutedEvent SkipLoadStoryboardEvent = EventManager.RegisterRoutedEvent("SkipLoadStoryboard", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUWindow>), typeof(PUWindow));
internal event RoutedPropertyChangedEventHandler<PUWindow> SkipLoadStoryboard
{
add { AddHandler(SkipLoadStoryboardEvent, value); }
remove { RemoveHandler(SkipLoadStoryboardEvent, value); }
}
internal void OnSkipLoadStoryboard()
{
RoutedPropertyChangedEventArgs<PUWindow> arg = new RoutedPropertyChangedEventArgs<PUWindow>(null, this, SkipLoadStoryboardEvent);
RaiseEvent(arg);
}
/// <summary>
/// 使用动画关闭窗体。
/// </summary>
internal static readonly RoutedEvent BeginCloseStoryboardEvent = EventManager.RegisterRoutedEvent("BeginCloseStoryboard", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUWindow>), typeof(PUWindow));
internal event RoutedPropertyChangedEventHandler<PUWindow> BeginCloseStoryboard
{
add { AddHandler(BeginCloseStoryboardEvent, value); }
remove { RemoveHandler(BeginCloseStoryboardEvent, value); }
}
internal void OnBeginCloseStoryboard()
{
RoutedPropertyChangedEventArgs<PUWindow> arg = new RoutedPropertyChangedEventArgs<PUWindow>(null, this, BeginCloseStoryboardEvent);
RaiseEvent(arg);
}
#endregion
#region Property
/// <summary>
/// 获取或设置窗体的返回结果,不会对前端显示造成影响。默认值为Null
/// </summary>
public object Result
{
get { return (object)GetValue(ResultProperty); }
set { SetValue(ResultProperty, value); }
}
public static readonly DependencyProperty ResultProperty =
DependencyProperty.Register("Result", typeof(object), typeof(PUWindow));
/// <summary>
///获取或设置是否打开窗体的遮罩层。默认值为False。
/// </summary>
public bool IsCoverMaskShow
{
get { return (bool)GetValue(IsCoverMaskShowProperty); }
set { SetValue(IsCoverMaskShowProperty, value); }
}
public static readonly DependencyProperty IsCoverMaskShowProperty =
DependencyProperty.Register("IsCoverMaskShow", typeof(bool), typeof(PUWindow));
/// <summary>
/// 获取或设置是否允许延迟显示内容。当页面内容较为复杂时,启用此选项有助于减少启动动画卡顿。默认值为False。
/// </summary>
public bool AllowShowDelay
{
get { return (bool)GetValue(AllowShowDelayProperty); }
set { SetValue(AllowShowDelayProperty, value); }
}
public static readonly DependencyProperty AllowShowDelayProperty =
DependencyProperty.Register("AllowShowDelay", typeof(bool), typeof(PUWindow));
/// <summary>
/// 获取或设置右侧标题栏按钮的显示状态。默认值为Visible。
/// </summary>
public Visibility NavButtonVisibility
{
get { return (Visibility)GetValue(NavButtonVisibilityProperty); }
set { SetValue(NavButtonVisibilityProperty, value); }
}
public static readonly DependencyProperty NavButtonVisibilityProperty =
DependencyProperty.Register("NavButtonVisibility", typeof(Visibility), typeof(PUWindow), new PropertyMetadata(Visibility.Visible));
/// <summary>
/// 获取或设置是否在窗体打开时使用动画。默认值为True。
/// </summary>
public bool AnimateIn
{
get { return (bool)GetValue(AnimateInProperty); }
set { SetValue(AnimateInProperty, value); }
}
public static readonly DependencyProperty AnimateInProperty =
DependencyProperty.Register("AnimateIn", typeof(bool), typeof(PUWindow), new PropertyMetadata(true));
/// <summary>
/// 获取或设置是否在窗体关闭时使用动画,默认值为True。
/// </summary>
public bool AnimateOut
{
get { return (bool)GetValue(AnimateOutProperty); }
set { SetValue(AnimateOutProperty, value); }
}
public static readonly DependencyProperty AnimateOutProperty =
DependencyProperty.Register("AnimateOut", typeof(bool), typeof(PUWindow), new PropertyMetadata(true));
/// <summary>
/// 获取或设置窗体动画类型。默认值为Gradual(一个从上到下的渐变显示)。
/// </summary>
public AnimationStyles AnimationStyle
{
get { return (AnimationStyles)GetValue(AnimationStyleProperty); }
set { SetValue(AnimationStyleProperty, value); }
}
public static readonly DependencyProperty AnimationStyleProperty =
DependencyProperty.Register("AnimationStyle", typeof(AnimationStyles), typeof(PUWindow), new PropertyMetadata(AnimationStyles.Scale));
/// <summary>
/// 获取或设置窗体的圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUWindow));
/// <summary>
/// 左上角标题,默认值为null。
/// <para>当该属性为null时,将采用Title属性来填充左上角标题。</para>
/// </summary>
public object Header
{
get { return (object)GetValue(HeaderProperty); }
set { SetValue(HeaderProperty, value); }
}
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register("Header", typeof(object), typeof(PUWindow));
/// <summary>
/// 左上角图标,默认值为null。
/// </summary>
public new object Icon
{
get { return (object)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public new static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(object), typeof(PUWindow));
/// <summary>
/// 控制栏背景色,默认值为White(白色)。
/// </summary>
public Brush NavbarBackground
{
get { return (Brush)GetValue(NavbarBackgroundProperty); }
set { SetValue(NavbarBackgroundProperty, value); }
}
public static readonly DependencyProperty NavbarBackgroundProperty =
DependencyProperty.Register("NavbarBackground", typeof(Brush), typeof(PUWindow));
/// <summary>
/// 控制栏高度,默认值为30。
/// </summary>
public double NavbarHeight
{
get { return (double)GetValue(NavbarHeightProperty); }
set { SetValue(NavbarHeightProperty, value); }
}
public static readonly DependencyProperty NavbarHeightProperty =
DependencyProperty.Register("NavbarHeight", typeof(double), typeof(PUWindow));
/// <summary>
/// 控制按钮高度,默认值为30。
/// </summary>
public double NavButtonHeight
{
get { return (double)GetValue(NavButtonHeightProperty); }
set { SetValue(NavButtonHeightProperty, value); }
}
public static readonly DependencyProperty NavButtonHeightProperty =
DependencyProperty.Register("NavButtonHeight", typeof(double), typeof(PUWindow));
/// <summary>
/// 控制按钮宽度,默认值为40。
/// </summary>
public double NavButtonWidth
{
get { return (double)GetValue(NavButtonWidthProperty); }
set { SetValue(NavButtonWidthProperty, value); }
}
public static readonly DependencyProperty NavButtonWidthProperty =
DependencyProperty.Register("NavButtonWidth", typeof(double), typeof(PUWindow));
/// <summary>
/// 是否打开遮罩层并显示等待控件。
/// </summary>
public bool IsAwaitShow
{
get { return (bool)GetValue(IsAwaitShowProperty); }
set { SetValue(IsAwaitShowProperty, value); }
}
public static readonly DependencyProperty IsAwaitShowProperty =
DependencyProperty.Register("IsAwaitShow", typeof(bool), typeof(PUWindow));
/// <summary>
/// 获取或设置是否允许在调用Show或ShowDialog方法时自动打开父窗体的遮罩层,并在Close时将其关闭。
/// <para>若没有父窗体或父窗体不是PUWindow类型,则不会触发任何效果。</para>
/// </summary>
public bool AllowAutoCoverMask
{
get { return (bool)GetValue(AllowAutoCoverMaskProperty); }
set { SetValue(AllowAutoCoverMaskProperty, value); }
}
public static readonly DependencyProperty AllowAutoCoverMaskProperty =
DependencyProperty.Register("AllowAutoCoverMask", typeof(bool), typeof(PUWindow), new PropertyMetadata(false));
/// <summary>
/// 获取或设置是否允许用户使用Alt + F4按键组合强制关闭窗体。该属性在窗体加载后的更改将无效。默认值为True(允许)。
/// </summary>
public bool AllowForcingClose
{
get { return (bool)GetValue(AllowForcingCloseProperty); }
set { SetValue(AllowForcingCloseProperty, value); }
}
public static readonly DependencyProperty AllowForcingCloseProperty =
DependencyProperty.Register("AllowForcingClose", typeof(bool), typeof(PUWindow), new PropertyMetadata(true));
/// <summary>
/// 获取或设置是否允许自动将当前的活动窗口设置为自己的Owner。默认值为True。
/// </summary>
public bool AllowAutoOwner
{
get { return (bool)GetValue(AllowAutoOwnerProperty); }
set { SetValue(AllowAutoOwnerProperty, value); }
}
public static readonly DependencyProperty AllowAutoOwnerProperty =
DependencyProperty.Register("AllowAutoOwner", typeof(bool), typeof(PUWindow), new PropertyMetadata(false, OnAllowAutoOwnerChanged));
private static void OnAllowAutoOwnerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var window = d as PUWindow;
if (window.AllowAutoOwner == true)
{
try
{
window.Owner = GetOwnerWindow();
}
catch (Exception ex) { }
}
}
#endregion
#region Internal APIs
#endregion
#region Command
/// <summary>
/// 关闭命令
/// </summary>
public ICommand CloseCommand
{
get
{ return _closeCommad; }
}
private ICommand _closeCommad = new CloseWindowCommand();
/// <summary>
/// 最大化命令
/// </summary>
public ICommand MaxCommand
{
get
{ return _maxCommand; }
}
private ICommand _maxCommand = new MaxWindowCommand();
/// <summary>
/// 最小化命令
/// </summary>
public ICommand MinCommand
{
get
{ return _minCommand; }
}
private ICommand _minCommand = new MinWindowCommand();
#endregion
#region APIs
/// <summary>
/// 向控制栏的左侧添加一个新的按钮。
/// <para>警告:当Window的前景色发生改变时,该按钮的前景色不会随之变化。</para>
/// </summary>
/// <param name="content">按钮的内容</param>
/// <param name="clickHandler">点击按钮时应该触发的事件。</param>
public void AppendNavButton(object content, RoutedEventHandler clickHandler, bool isIconFont = true, object tooltip = null)
{
var btn = new PUButton()
{
Content = content,
ButtonStyle = ButtonStyles.Hollow,
Foreground = Foreground,
BorderBrush = new SolidColorBrush(Colors.Transparent),
CoverBrush = new SolidColorBrush(((Color)ColorConverter.ConvertFromString("#99999999"))),
HorizontalAlignment = HorizontalAlignment.Right,
};
if (isIconFont)
btn.FontFamily = FindResource("IconFont") as FontFamily;
if (tooltip != null)
btn.ToolTip = tooltip;
var visibility = new Binding() { Path = new PropertyPath("NavButtonVisibility"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Source = this, Mode = BindingMode.OneWay };
BindingOperations.SetBinding(btn, VisibilityProperty, visibility);
var width = new Binding() { Path = new PropertyPath("NavButtonWidth"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Source = this, Mode = BindingMode.OneWay };
BindingOperations.SetBinding(btn, WidthProperty, width);
var height = new Binding() { Path = new PropertyPath("NavButtonHeight"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Source = this, Mode = BindingMode.OneWay };
BindingOperations.SetBinding(btn, HeightProperty, height);
var fontsize = new Binding() { Path = new PropertyPath("FontSize"), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Source = this, Mode = BindingMode.OneWay };
BindingOperations.SetBinding(btn, FontSizeProperty, fontsize);
btn.Click += clickHandler;
if (IsLoaded)
_stkNav.Children.Insert(0, btn);
else
{
Loaded += delegate
{
_stkNav.Children.Insert(0, btn);
};
}
}
#endregion
#region Function
private static bool IsModal(Window window)
{
return (bool)typeof(Window).GetField("_showingAsDialog", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(window);
}
private static PUWindow GetWindowFromHwnd(IntPtr hwnd)
{
var visual = HwndSource.FromHwnd(hwnd).RootVisual;
return visual as PUWindow;
}
private static PUWindow GetOwnerWindow()
{
var hwnd = GetForegroundWindow();
if (hwnd == null)
return null;
return GetWindowFromHwnd(hwnd);
}
#endregion
}
internal class CloseWindowCommand : ICommand
{
event EventHandler ICommand.CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
var window = (parameter as PUWindow);
window.Close();
}
}
internal class MaxWindowCommand : ICommand
{
event EventHandler ICommand.CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
var window = (parameter as PUWindow);
if (window.WindowState == WindowState.Maximized)
window.WindowState = WindowState.Normal;
else
window.WindowState = WindowState.Maximized;
}
}
internal class MinWindowCommand : ICommand
{
event EventHandler ICommand.CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
(parameter as PUWindow).WindowState = WindowState.Minimized;
}
}
}
================================================
FILE: Panuon.UI/2_Button/PUButton.cs
================================================
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUButton : Button
{
static PUButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUButton), new FrameworkPropertyMetadata(typeof(PUButton)));
}
#region Property
/// <summary>
/// 效果等同于Tag,无实际作用。
/// </summary>
public object Value
{
get { return (object)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(object), typeof(PUButton));
/// <summary>
/// 获取或设置按钮的基本样式。默认值为标准样式(General)。
/// </summary>
public ButtonStyles ButtonStyle
{
get { return (ButtonStyles)GetValue(ButtonStyleProperty); }
set { SetValue(ButtonStyleProperty, value); }
}
public static readonly DependencyProperty ButtonStyleProperty = DependencyProperty.Register("ButtonStyle", typeof(ButtonStyles), typeof(PUButton), new PropertyMetadata(ButtonStyles.General));
/// <summary>
/// 获取或设置鼠标点击时按钮的效果。默认为无特殊效果(Classic)。
/// </summary>
public ClickStyles ClickStyle
{
get { return (ClickStyles)GetValue(ClickStyleProperty); }
set { SetValue(ClickStyleProperty, value); }
}
public static readonly DependencyProperty ClickStyleProperty =
DependencyProperty.Register("ClickStyle", typeof(ClickStyles), typeof(PUButton), new PropertyMetadata(ClickStyles.Classic));
/// <summary>
/// 获取或设置按钮的圆角大小。默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUButton));
/// <summary>
/// 获取或设置鼠标悬浮时遮罩层的背景颜色(在Outline和Link样式下为前景色),默认值为#26FFFFFF(在Hollow、Outline和Link样式下为灰黑色)。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUButton));
#endregion
}
}
================================================
FILE: Panuon.UI/2_Button/PURepeatButton.cs
================================================
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
namespace Panuon.UI
{
public class PURepeatButton : RepeatButton
{
static PURepeatButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PURepeatButton), new FrameworkPropertyMetadata(typeof(PURepeatButton)));
}
#region Property
/// <summary>
/// 获取或设置按钮的基本样式。默认值为标准样式(General)。
/// </summary>
public RepeatButtonStyles RepeatButtonStyle
{
get { return (RepeatButtonStyles)GetValue(RepeatButtonStyleProperty); }
set { SetValue(RepeatButtonStyleProperty, value); }
}
public static readonly DependencyProperty RepeatButtonStyleProperty = DependencyProperty.Register("RepeatButtonStyle", typeof(RepeatButtonStyles), typeof(PURepeatButton), new PropertyMetadata(RepeatButtonStyles.General));
/// <summary>
/// 获取或设置鼠标点击时按钮的效果。默认为无效果(Classic)。
/// </summary>
public ClickStyles ClickStyle
{
get { return (ClickStyles)GetValue(ClickStyleProperty); }
set { SetValue(ClickStyleProperty, value); }
}
public static readonly DependencyProperty ClickStyleProperty =
DependencyProperty.Register("ClickStyle", typeof(ClickStyles), typeof(PURepeatButton), new PropertyMetadata(ClickStyles.Classic));
/// <summary>
/// 圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty = DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PURepeatButton), new PropertyMetadata(new CornerRadius(0)));
/// <summary>
/// 鼠标悬浮时遮罩层的背景颜色(在Outline和Link样式下为前景色),默认值为白色(在Outline和Link样式下为灰色)。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty = DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PURepeatButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));
#endregion
}
}
================================================
FILE: Panuon.UI/3_TextBox/PUTextBox.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUTextBox : TextBox
{
static PUTextBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUTextBox), new FrameworkPropertyMetadata(typeof(PUTextBox)));
}
#region Sys
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
AddHandler(PUButton.ClickEvent, new RoutedEventHandler(OnClearButtonClick));
ScrollViewer scrollViewer = new ScrollViewer();
if (TextBoxStyle == TextBoxStyles.General)
{
scrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 1), 0), 0) as ScrollViewer;
}
else if (TextBoxStyle == TextBoxStyles.IconGroup)
{
scrollViewer = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 1), 0), 1), 0) as ScrollViewer;
}
if(scrollViewer != null)
scrollViewer.MouseWheel += ScrollViewer_MouseWheel;
PreviewKeyDown += PUTextBox_PreviewKeyDown;
}
private void PUTextBox_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (TextType == TextTypes.Text)
return;
else
{
switch (e.Key)
{
case System.Windows.Input.Key.D0:
case System.Windows.Input.Key.D1:
case System.Windows.Input.Key.D2:
case System.Windows.Input.Key.D3:
case System.Windows.Input.Key.D4:
case System.Windows.Input.Key.D5:
case System.Windows.Input.Key.D6:
case System.Windows.Input.Key.D7:
case System.Windows.Input.Key.D8:
case System.Windows.Input.Key.D9:
case System.Windows.Input.Key.NumPad0:
case System.Windows.Input.Key.NumPad1:
case System.Windows.Input.Key.NumPad2:
case System.Windows.Input.Key.NumPad3:
case System.Windows.Input.Key.NumPad4:
case System.Windows.Input.Key.NumPad5:
case System.Windows.Input.Key.NumPad6:
case System.Windows.Input.Key.NumPad7:
case System.Windows.Input.Key.NumPad8:
case System.Windows.Input.Key.NumPad9:
case System.Windows.Input.Key.Enter:
case System.Windows.Input.Key.Back:
case System.Windows.Input.Key.Delete:
case System.Windows.Input.Key.Left:
case System.Windows.Input.Key.Right:
case System.Windows.Input.Key.Up:
case System.Windows.Input.Key.Down:
case System.Windows.Input.Key.Home:
case System.Windows.Input.Key.End:
case System.Windows.Input.Key.Tab:
break;
case System.Windows.Input.Key.OemPeriod:
if (TextType != TextTypes.Decimal)
e.Handled = true;
break;
default:
e.Handled = true;
break;
}
}
}
private void OnClearButtonClick(object sender, RoutedEventArgs e)
{
var btnClear = e.OriginalSource as PUButton;
if (btnClear.Tag == null || btnClear.Tag.ToString() != "Clear")
return;
Text = "";
}
private void ScrollViewer_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
{
var scrollViewer = sender as ScrollViewer;
if (e.Delta > 0)
if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Visible)
scrollViewer.LineUp();
else if (scrollViewer.ComputedHorizontalScrollBarVisibility == Visibility.Visible)
scrollViewer.LineLeft();
else
return;
else
if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Visible)
scrollViewer.LineDown();
else if (scrollViewer.ComputedHorizontalScrollBarVisibility == Visibility.Visible)
scrollViewer.LineRight();
else
return;
if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Visible || scrollViewer.ComputedHorizontalScrollBarVisibility == Visibility.Visible)
e.Handled = true;
}
#endregion
#region Property
/// <summary>
/// 获取或设置文本框的基本样式。默认值为General。
/// </summary>
public TextBoxStyles TextBoxStyle
{
get { return (TextBoxStyles)GetValue(TextBoxStyleProperty); }
set { SetValue(TextBoxStyleProperty, value); }
}
public static readonly DependencyProperty TextBoxStyleProperty =
DependencyProperty.Register("TextBoxStyle", typeof(TextBoxStyles), typeof(PUTextBox), new PropertyMetadata(TextBoxStyles.General));
/// <summary>
/// 获取或设置文本框的圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUTextBox));
/// <summary>
/// 获取或设置输入框获得焦点时阴影的颜色,默认值为#66888888。
/// </summary>
public Color ShadowColor
{
get { return (Color)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("ShadowColor", typeof(Color), typeof(PUTextBox));
/// <summary>
/// 获取或设置水印内容。默认值为空。
/// </summary>
public string Watermark
{
get { return (string)GetValue(WatermarkProperty); }
set { SetValue(WatermarkProperty, value); }
}
public static readonly DependencyProperty WatermarkProperty =
DependencyProperty.Register("Watermark", typeof(string), typeof(PUTextBox));
/// <summary>
/// 获取或设置i放置在输入框前的图标。
/// <para>仅当输入框样式为IconGroup时有效。</para>
/// </summary>
public object Icon
{
get { return (object)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(object), typeof(PUTextBox));
/// <summary>
/// 获取或设置图标的宽度,默认值为30。
/// <para>仅当输入框样式为IconGroup时有效。</para>
/// </summary>
public double IconWidth
{
get { return (double)GetValue(IconWidthProperty); }
set { SetValue(IconWidthProperty, value); }
}
public static readonly DependencyProperty IconWidthProperty =
DependencyProperty.Register("IconWidth", typeof(double), typeof(PUTextBox), new PropertyMetadata((double)30));
/// <summary>
/// 获取或设置当鼠标悬浮时是否显示清除按钮。默认值为False。
/// </summary>
public bool IsClearButtonShow
{
get { return (bool)GetValue(IsClearButtonShowProperty); }
set { SetValue(IsClearButtonShowProperty, value); }
}
public static readonly DependencyProperty IsClearButtonShowProperty =
DependencyProperty.Register("IsClearButtonShow", typeof(bool), typeof(PUTextBox));
/// <summary>
/// 获取或设置允许键入的类型。默认值为Text(全部内容)。
/// </summary>
public TextTypes TextType
{
get { return (TextTypes)GetValue(TextTypeProperty); }
set { SetValue(TextTypeProperty, value); }
}
public static readonly DependencyProperty TextTypeProperty =
DependencyProperty.Register("TextType", typeof(TextTypes), typeof(PUTextBox), new PropertyMetadata(TextTypes.Text, OnTextTypeChanged));
private static void OnTextTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var textBox = d as PUTextBox;
if(textBox.TextType == TextTypes.Text)
{
System.Windows.Input.InputMethod.SetIsInputMethodEnabled(textBox, true);
}
else
{
System.Windows.Input.InputMethod.SetIsInputMethodEnabled(textBox, false);
}
}
#endregion
}
}
================================================
FILE: Panuon.UI/4_PasswordBox/PUPasswordBox.cs
================================================
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
namespace Panuon.UI
{
[ContentProperty(nameof(Password))]
public class PUPasswordBox : TextBox
{
/*严重警告:
*PasswordBox是一个密封类,因此控件无法直接从PasswordBox派生。
*该控件继承自TextBox,因此无法保证在装有恶意软件的计算机上的密码安全(恶意软件可以通过内存读取密码)。
*如果对密码安全有较高的需求,切勿使用此控件。*/
static PUPasswordBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUPasswordBox), new FrameworkPropertyMetadata(typeof(PUPasswordBox)));
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
AcceptsReturn = false;
PUButton btnShowPwd;
if(PasswordBoxStyle == PasswordBoxStyles.General)
btnShowPwd = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 1), 0), 2) as PUButton;
else
btnShowPwd = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(this, 0), 1), 0), 1), 2) as PUButton;
btnShowPwd.PreviewMouseLeftButtonDown += BtnShowPwd_MouseLeftButtonDown;
btnShowPwd.PreviewMouseLeftButtonUp += BtnShowPwd_MouseLeftButtonUp;
ContextMenu = null;
Text = "";
if (Password != null && Password != "")
for (int i = 0; i < Password.Length; i++)
Text += PasswordChar;
PreviewTextInput += PUPasswordBox_TextInput;
PreviewKeyDown += PUPasswordBox_PreviewKeyDown;
}
private void BtnShowPwd_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
Text = "";
for (int i = 0; i < Password.Length; i++)
Text += PasswordChar;
}
private void BtnShowPwd_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Text = Password;
}
#region Sys
private void PUPasswordBox_TextInput(object sender, TextCompositionEventArgs e)
{
Password = Password ?? "";
if ((MaxLength != 0 && Password.Length >= MaxLength) && SelectionLength == 0)
{
e.Handled = true;
return;
}
if (e.Text == "\n" || e.Text == "\r" || e.Text == "\t")
return;
var currentCursor = SelectionStart;
if (SelectionLength != 0)
{
var length = SelectionLength;
Password = Password.Remove(currentCursor, length);
}
Password = Password.Insert(currentCursor, e.Text);
Select(currentCursor + 1, 0);
e.Handled = true;
}
private void PUPasswordBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
//禁止任何与Control键有关的事(除了全选)
if ((Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.A)))
{
e.Handled = true;
return;
}
if (e.Key == Key.Enter)
return;
var currentCursor = SelectionStart;
switch (e.Key)
{
case Key.Back:
if (Text.Length > 0 && currentCursor > 0 && SelectionLength == 0)
{
Password = Password.Remove(currentCursor - 1, 1);
if (currentCursor > 0)
Select(currentCursor - 1, 0);
}
else if (SelectionLength > 0)
{
var length = SelectionLength;
Password = Password.Remove(currentCursor, length);
Select(currentCursor, 0);
}
//批量选择情况下
break;
case Key.Delete:
if (currentCursor < Text.Length)
{
Password = Password.Remove(currentCursor, 1);
Select(currentCursor, 0);
}
break;
case Key.Space:
if (SelectionLength != 0)
{
Password = Password.Remove(currentCursor, SelectionLength);
}
Password = Password.Insert(currentCursor, " ");
Select(currentCursor + 1, 0);
break;
default:
return;
}
e.Handled = true;
}
#endregion
#region RoutedEvent
/// <summary>
/// 密码改变事件。
/// </summary>
public static readonly RoutedEvent PasswordChangedEvent = EventManager.RegisterRoutedEvent("PasswordChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<string>), typeof(PUPasswordBox));
public event RoutedPropertyChangedEventHandler<string> PasswordChanged
{
add { AddHandler(PasswordChangedEvent, value); }
remove { RemoveHandler(PasswordChangedEvent, value); }
}
#endregion
#region Property
[Obsolete("不能对密码框的Text属性赋值。")]
public new string Text
{
get { return base.Text; }
private set { base.Text = value; }
}
/// <summary>
/// 密码属性
/// </summary>
public string Password
{
get { return (string)GetValue(PasswordProperty); }
set { SetValue(PasswordProperty, value); }
}
public static readonly DependencyProperty PasswordProperty =
DependencyProperty.Register("Password", typeof(string), typeof(PUPasswordBox), new PropertyMetadata("", OnPasswordChanged));
private static void OnPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var pb = d as PUPasswordBox;
var val = (string)e.NewValue;
pb.Text = "";
if (pb.Password != null && pb.Password != "")
for (int i = 0; i < pb.Password.Length; i++)
pb.Text += pb.PasswordChar;
RoutedPropertyChangedEventArgs<string> arg = new RoutedPropertyChangedEventArgs<string>(val, pb.Password, PasswordChangedEvent);
pb.RaiseEvent(arg);
}
/// <summary>
/// 密码掩饰字符,默认值为●。
/// </summary>
public char PasswordChar
{
get { return (char)GetValue(PasswordCharProperty); }
set { SetValue(PasswordCharProperty, value); }
}
public static readonly DependencyProperty PasswordCharProperty =
DependencyProperty.Register("PasswordChar", typeof(char), typeof(PUPasswordBox), new PropertyMetadata('●'));
/// <summary>
/// 密码框样式,默认值为General。
/// </summary>
public PasswordBoxStyles PasswordBoxStyle
{
get { return (PasswordBoxStyles)GetValue(PasswordBoxStyleProperty); }
set { SetValue(PasswordBoxStyleProperty, value); }
}
public static readonly DependencyProperty PasswordBoxStyleProperty =
DependencyProperty.Register("PasswordBoxStyle", typeof(PasswordBoxStyles), typeof(PUPasswordBox), new PropertyMetadata(PasswordBoxStyles.General));
/// <summary>
/// 圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty = DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUPasswordBox), new PropertyMetadata(new CornerRadius(0)));
/// <summary>
/// 密码框激活时阴影的颜色,默认值为#888888。
/// </summary>
public Color ShadowColor
{
get { return (Color)GetValue(ShadowColorProperty); }
set { SetValue(ShadowColorProperty, value); }
}
public static readonly DependencyProperty ShadowColorProperty = DependencyProperty.Register("ShadowColor", typeof(Color), typeof(PUPasswordBox), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#888888")));
/// <summary>
/// 水印内容,默认值为空。
/// </summary>
public string Watermark
{
get { return (string)GetValue(WatermarkProperty); }
set { SetValue(WatermarkProperty, value); }
}
public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register("Watermark", typeof(string), typeof(PUPasswordBox));
/// <summary>
/// 放置在密码框前的图标。
/// <para>仅当密码框样式为IconGroup时有效。</para>
/// </summary>
public object Icon
{
get { return (object)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(object), typeof(PUPasswordBox));
/// <summary>
/// 图标的宽度,默认值为30。
/// <para>仅当密码框样式为IconGroup时有效。</para>
/// </summary>
public double IconWidth
{
get { return (double)GetValue(IconWidthProperty); }
set { SetValue(IconWidthProperty, value); }
}
public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register("IconWidth", typeof(double), typeof(PUPasswordBox), new PropertyMetadata((double)30));
/// <summary>
/// 获取或设置当鼠标悬浮时是否显示 显示密码 按钮。默认值为False。
/// </summary>
public bool IsShowPwdButtonShow
{
get { return (bool)GetValue(IsShowPwdButtonShowProperty); }
set { SetValue(IsShowPwdButtonShowProperty, value); }
}
public static readonly DependencyProperty IsShowPwdButtonShowProperty =
DependencyProperty.Register("IsShowPwdButtonShow", typeof(bool), typeof(PUPasswordBox));
#endregion
}
}
================================================
FILE: Panuon.UI/5_ComboBox/PUComboBox.cs
================================================
using Panuon.UI.Utils;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUComboBox : ComboBox
{
static PUComboBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUComboBox), new FrameworkPropertyMetadata(typeof(PUComboBox)));
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
if (SearchMode == SearchModes.TextChanged)
{
AddHandler(PUTextBox.TextChangedEvent, new RoutedEventHandler(OnSearchTextChanged));
SearchBoxVisibility = Visibility.Visible;
}
else if (SearchMode == SearchModes.Enter)
{
AddHandler(PUTextBox.PreviewKeyDownEvent, new RoutedEventHandler(OnSearchKeyDown));
SearchBoxVisibility = Visibility.Visible;
}
else
{
SearchBoxVisibility = Visibility.Collapsed;
}
}
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
{
if (SelectedValuePath == SelectedValuePaths.Header)
SelectedValue = SelectedItem == null ? "" : (SelectedItem as PUComboBoxItem).Content;
else
SelectedValue = SelectedItem == null ? null : (SelectedItem as PUComboBoxItem).Value;
base.OnSelectionChanged(e);
}
private void OnSearchKeyDown(object sender, RoutedEventArgs e)
{
var eve = e as System.Windows.Input.KeyEventArgs;
if (eve.Key != System.Windows.Input.Key.Enter)
return;
var tbSearch = e.OriginalSource as PUTextBox;
if (tbSearch == null || tbSearch.Tag == null || tbSearch.Tag.ToString() != "Search")
return;
var text = tbSearch.Text;
foreach (var item in Items)
{
var comboItem = item as ComboBoxItem;
if (comboItem.Content.ToString().Contains(text))
comboItem.Visibility = Visibility.Visible;
else
comboItem.Visibility = Visibility.Collapsed;
}
e.Handled = true;
}
private void OnSearchTextChanged(object sender, RoutedEventArgs e)
{
var tbSearch = e.OriginalSource as PUTextBox;
if (tbSearch == null || tbSearch.Tag == null || tbSearch.Tag.ToString() != "Search")
return;
var text = tbSearch.Text;
foreach (var item in Items)
{
var comboItem = item as ComboBoxItem;
if (comboItem.Content.ToString().Contains(text))
comboItem.Visibility = Visibility.Visible;
else
comboItem.Visibility = Visibility.Collapsed;
}
}
#region RoutedEvent
/// <summary>
/// 用户点击删除按钮事件。
/// </summary>
public static readonly RoutedEvent DeleteItemEvent = EventManager.RegisterRoutedEvent("DeleteItem", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUComboBoxItem>), typeof(PUComboBox));
public event RoutedPropertyChangedEventHandler<PUComboBoxItem> DeleteItem
{
add { AddHandler(DeleteItemEvent, value); }
remove { RemoveHandler(DeleteItemEvent, value); }
}
internal void OnDeleteItem(PUComboBoxItem oldItem, PUComboBoxItem newItem)
{
RoutedPropertyChangedEventArgs<PUComboBoxItem> arg = new RoutedPropertyChangedEventArgs<PUComboBoxItem>(oldItem, newItem, DeleteItemEvent);
RaiseEvent(arg);
}
#endregion
#region Property
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("该属性对此控件无效。请使用BindingItems属性替代。", true)]
public new IEnumerable ItemsSource
{
get { return base.ItemsSource; }
private set { base.ItemsSource = value; }
}
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("该属性对此控件无效。BindingItems属性中的Header属性即为要显示的内容。", true)]
public new string DisplayMemberPath
{
get { return base.DisplayMemberPath; }
private set { base.DisplayMemberPath = value; }
}
/// <summary>
/// 获取或设置鼠标悬浮时子项的背景颜色。默认值为浅灰色(#EEEEEE)。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUComboBox), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#EEEEEE"))));
/// <summary>
/// 获取或设置子项被选中时的背景颜色。默认值为浅灰色(#DDDDDD)。
/// </summary>
public Brush SelectedBrush
{
get { return (Brush)GetValue(SelectedBrushProperty); }
set { SetValue(SelectedBrushProperty, value); }
}
// Using a DependencyProperty as the backing store for SelectedBrush. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SelectedBrushProperty =
DependencyProperty.Register("SelectedBrush", typeof(Brush), typeof(PUComboBox), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#DDDDDD"))));
/// <summary>
/// 获取或设置显示框和下拉框的圆角大小。默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUComboBox), new PropertyMetadata(new CornerRadius(0)));
/// <summary>
/// 获取或设置下拉框激活时阴影的颜色,默认值为#888888。
/// </summary>
public Color ShadowColor
{
get { return (Color)GetValue(ShadowColorProperty); }
set { SetValue(ShadowColorProperty, value); }
}
public static readonly DependencyProperty ShadowColorProperty = DependencyProperty.Register("ShadowColor", typeof(Color), typeof(PUComboBox), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#888888")));
/// <summary>
/// 获取或设置当子项目可删除时,用户点击删除按钮后的操作。默认为删除项目并触发DeleteItem路由事件。
/// </summary>
public DeleteModes DeleteMode
{
get { return (DeleteModes)GetValue(DeleteModeProperty); }
set { SetValue(DeleteModeProperty, value); }
}
public static readonly DependencyProperty DeleteModeProperty =
DependencyProperty.Register("DeleteMode", typeof(DeleteModes), typeof(PUComboBox), new PropertyMetadata(DeleteModes.Delete));
/// <summary>
/// 若使用MVVM绑定,请使用此依赖属性。
/// </summary>
public ObservableCollection<PUComboBoxItemModel> BindingItems
{
get { return (ObservableCollection<PUComboBoxItemModel>)GetValue(BindingItemsProperty); }
set { SetValue(BindingItemsProperty, value); }
}
public static readonly DependencyProperty BindingItemsProperty =
DependencyProperty.Register("BindingItems", typeof(ObservableCollection<PUComboBoxItemModel>), typeof(PUComboBox), new PropertyMetadata(null, OnBindingItemsChanged));
private static void OnBindingItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var comboBox = d as PUComboBox;
if (comboBox.BindingItems != null)
{
comboBox.BindingItems.CollectionChanged -= comboBox.BindingItemChanged;
comboBox.BindingItems.CollectionChanged += comboBox.BindingItemChanged;
}
comboBox.GenerateBindindItems(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
private void BindingItemChanged(object sender, NotifyCollectionChangedEventArgs e)
{
GenerateBindindItems(e);
}
/// <summary>
/// 获取或设置当子项目被选中时,SelectedValue应呈现子项目的哪一个值。(在ComboBox中,Header属性表示展现子项的Content属性)
/// 可选项为Header或Value,默认值为Header。
/// </summary>
public new SelectedValuePaths SelectedValuePath
{
get { return (SelectedValuePaths)GetValue(SelectedValuePathProperty); }
set { SetValue(SelectedValuePathProperty, value); }
}
public new static readonly DependencyProperty SelectedValuePathProperty =
DependencyProperty.Register("SelectedValuePath", typeof(SelectedValuePaths), typeof(PUComboBox), new PropertyMetadata(SelectedValuePaths.Header));
/// <summary>
/// 获取被选中PUComboBoxItem的Header或Value属性(这取决于SelectedValuePath),
/// 或根据设置的SelectedValue来选中子项目。
/// </summary>
public new object SelectedValue
{
get { return (object)GetValue(SelectedValueProperty); }
set { SetValue(SelectedValueProperty, value); }
}
public new static readonly DependencyProperty SelectedValueProperty =
DependencyProperty.Register("SelectedValue", typeof(object), typeof(PUComboBox), new PropertyMetadata("", OnSelectedValueChanged));
private static void OnSelectedValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var comboBox = d as PUComboBox;
if (comboBox.SelectedValue == null)
{
return;
}
if (e.NewValue.Equals(e.OldValue))
return;
var selectedItem = comboBox.SelectedItem as PUComboBoxItem;
foreach (var item in comboBox.Items)
{
var comboBoxItem = item as PUComboBoxItem;
if ((comboBox.SelectedValuePath == SelectedValuePaths.Header ?
(comboBoxItem.Content == null ? false : comboBoxItem.Content.Equals(comboBox.SelectedValue)) :
(comboBoxItem.Value == null ? false : comboBoxItem.Value.Equals(comboBox.SelectedValue))))
{
if (!comboBoxItem.IsSelected)
comboBoxItem.IsSelected = true;
return;
}
}
}
/// <summary>
/// 获取或设置搜索模式。默认为不显示搜索。
/// </summary>
public SearchModes SearchMode
{
get { return (SearchModes)GetValue(SearchModeProperty); }
set { SetValue(SearchModeProperty, value); }
}
public static readonly DependencyProperty SearchModeProperty =
DependencyProperty.Register("SearchMode", typeof(SearchModes), typeof(PUComboBox), new PropertyMetadata(SearchModes.None, OnSearchModeChanged));
private static void OnSearchModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var comboBox = d as PUComboBox;
if (comboBox.IsLoaded)
{
comboBox.RemoveHandler(PUTextBox.TextChangedEvent, new RoutedEventHandler(comboBox.OnSearchTextChanged));
comboBox.RemoveHandler(PUTextBox.KeyDownEvent, new RoutedEventHandler(comboBox.OnSearchKeyDown));
if (comboBox.SearchMode == SearchModes.TextChanged)
{
comboBox.AddHandler(PUTextBox.TextChangedEvent, new RoutedEventHandler(comboBox.OnSearchTextChanged));
comboBox.SearchBoxVisibility = Visibility.Visible;
}
else if (comboBox.SearchMode == SearchModes.Enter)
{
comboBox.AddHandler(PUTextBox.PreviewKeyDownEvent, new RoutedEventHandler(comboBox.OnSearchKeyDown));
comboBox.SearchBoxVisibility = Visibility.Visible;
}
else
{
comboBox.SearchBoxVisibility = Visibility.Collapsed;
}
}
}
#endregion
#region Internal Property
internal Visibility SearchBoxVisibility
{
get { return (Visibility)GetValue(SearchBoxVisibilityProperty); }
set { SetValue(SearchBoxVisibilityProperty, value); }
}
internal static readonly DependencyProperty SearchBoxVisibilityProperty =
DependencyProperty.Register("SearchBoxVisibility", typeof(Visibility), typeof(PUComboBox), new PropertyMetadata(Visibility.Collapsed));
#endregion
#region APIs
/// <summary>
/// 通过内容选中项目。
/// <para>若content不是值类型,则将逐一比较其中各个属性的值是否相等。</para>
/// </summary>
/// <param name="content">要匹配的内容。</param>
public void SelectItemByContent(object content)
{
var comboItem = GetItemByContent(content);
if (comboItem != null)
comboItem.IsSelected = true;
}
/// <summary>
/// 通过Value选中项目。
/// <para>若value不是值类型,则将逐一比较其中各个属性的值是否相等。</para>
/// </summary>
/// <param name="value">要匹配的value。</param>
public void SelectItemByValue(object value)
{
var comboItem = GetItemByValue(value);
if (comboItem != null)
comboItem.IsSelected = true;
}
#endregion
#region Function
private void GenerateBindindItems(NotifyCollectionChangedEventArgs e)
{
switch (e.Action)
{
case NotifyCollectionChangedAction.Reset:
var value = SelectedValue;
SelectedValue = null;
Items.Clear();
if (BindingItems == null)
break;
foreach (var item in BindingItems)
{
var comboBoxItem = GenerateComboBoxItem(item);
Items.Add(comboBoxItem);
}
SelectedValue = value;
break;
case NotifyCollectionChangedAction.Add:
foreach (var item in e.NewItems)
{
var comboBoxItem = GenerateComboBoxItem(item as PUComboBoxItemModel);
Items.Insert(e.NewStartingIndex, comboBoxItem);
}
break;
case NotifyCollectionChangedAction.Remove:
foreach (var item in e.OldItems)
{
Items.RemoveAt(e.OldStartingIndex);
}
break;
case NotifyCollectionChangedAction.Replace:
foreach (var item in e.NewItems)
{
var comboBoxItem = GenerateComboBoxItem(item as PUComboBoxItemModel);
Items[e.OldStartingIndex] = comboBoxItem;
}
break;
case NotifyCollectionChangedAction.Move:
{
var tabItem = Items[e.OldStartingIndex];
Items.RemoveAt(e.OldStartingIndex);
Items.Insert(e.NewStartingIndex, tabItem);
}
break;
}
if (SelectedValue != null)
{
if (SelectedValuePath == SelectedValuePaths.Header)
SelectItemByContent(SelectedValue);
else
SelectItemByValue(SelectedValue);
}
}
private PUComboBoxItem GenerateComboBoxItem(PUComboBoxItemModel model)
{
var comboBoxItem = new PUComboBoxItem()
{
Uid = model.Uid,
Content = model.Header,
Value = model.Value,
CanDelete = model.CanDelete,
};
model.PropertyChanged += delegate
{
comboBoxItem.Content = model.Header;
comboBoxItem.Value = model.Value;
comboBoxItem.CanDelete = model.CanDelete;
};
return comboBoxItem;
}
private PUComboBoxItem GetItemByContent(object content)
{
foreach (var item in Items)
{
var comboItem = item as PUComboBoxItem;
if (comboItem == null)
throw new Exception("PUComboBox的子项必须是PUComboBoxItem。");
if (comboItem.Content.IsEqual(content))
return comboItem;
}
return null;
}
private PUComboBoxItem GetItemByValue(object value)
{
foreach (var item in Items)
{
var comboItem = item as PUComboBoxItem;
if (comboItem == null)
throw new Exception("PUComboBox的子项必须是PUComboBoxItem。");
if (comboItem.Value.IsEqual(value))
return comboItem;
}
return null;
}
#endregion
}
}
================================================
FILE: Panuon.UI/5_ComboBox/PUComboBoxItem.cs
================================================
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Panuon.UI
{
public class PUComboBoxItem : ComboBoxItem
{
public PUComboBoxItem()
{
}
static PUComboBoxItem()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUComboBoxItem), new FrameworkPropertyMetadata(typeof(PUComboBoxItem)));
}
#region Property
/// <summary>
/// 获取或设置是否显示删除按钮,默认值为False(不显示)。
/// </summary>
public bool CanDelete
{
get { return (bool)GetValue(CanDeleteProperty); }
set { SetValue(CanDeleteProperty, value); }
}
public static readonly DependencyProperty CanDeleteProperty =
DependencyProperty.Register("CanDelete", typeof(bool), typeof(PUComboBoxItem));
/// <summary>
/// 获取或设置用以标记该项目的值。默认值为Null。
/// </summary>
public object Value
{
get { return (object)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(object), typeof(PUComboBoxItem));
#endregion
public ICommand DeleteCommand
{
get
{ return _deleteCommand; }
}
private ICommand _deleteCommand = new PUComboBoxDeleteCommand();
}
internal sealed class PUComboBoxDeleteCommand : ICommand
{
event EventHandler ICommand.CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
var comItem = (parameter as PUComboBoxItem);
var combox = comItem.Parent as PUComboBox;
if (combox.DeleteMode == DeleteModes.Delete)
{
if (combox.BindingItems != null && !String.IsNullOrEmpty((comItem.Uid)))
{
var model = combox.BindingItems.FirstOrDefault(x => x.Uid == comItem.Uid);
if (model != null)
combox.BindingItems.Remove(model);
else
combox.Items.Remove(comItem);
}
else
{
combox.Items.Remove(comItem);
}
}
combox.OnDeleteItem(null, comItem);
}
}
}
================================================
FILE: Panuon.UI/6_CheckBox/PUCheckBox.cs
================================================
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUCheckBox : CheckBox
{
static PUCheckBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUCheckBox), new FrameworkPropertyMetadata(typeof(PUCheckBox)));
}
#region Property
/// <summary>
/// 获取或设置选择框的基本样式。默认值为General。
/// </summary>
public CheckBoxStyles CheckBoxStyle
{
get { return (CheckBoxStyles)GetValue(CheckBoxStyleProperty); }
set { SetValue(CheckBoxStyleProperty, value); }
}
public static readonly DependencyProperty CheckBoxStyleProperty = DependencyProperty.Register("CheckBoxStyle", typeof(CheckBoxStyles), typeof(PUCheckBox), new PropertyMetadata(CheckBoxStyles.General));
/// <summary>
/// 获取或设置选择框的圆角大小。默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty = DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUCheckBox), new PropertyMetadata(new CornerRadius(0)));
/// <summary>
/// 获取或设置选择框的宽度。默认值为20(Switch样式下为30)。
/// </summary>
public double InnerWidth
{
get { return (double)GetValue(InnerWidthProperty); }
set
{ SetValue(InnerWidthProperty, value); }
}
public static readonly DependencyProperty InnerWidthProperty =
DependencyProperty.Register("InnerWidth", typeof(double), typeof(PUCheckBox), new PropertyMetadata((double)20));
/// <summary>
/// 获取或设置选择框的高度。默认值为20。
/// </summary>
public double InnerHeight
{
get { return (double)GetValue(InnerHeightProperty); }
set { SetValue(InnerHeightProperty, value); }
}
public static readonly DependencyProperty InnerHeightProperty =
DependencyProperty.Register("InnerHeight", typeof(double), typeof(PUCheckBox), new PropertyMetadata((double)20));
/// <summary>
/// Check时对号的背景颜色(或前景色),默认值为白色。
/// <para>仅当按钮样式为General时生效。</para>
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUCheckBox));
#endregion
}
}
================================================
FILE: Panuon.UI/7_RadioButton/PURadioButton.cs
================================================
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PURadioButton : RadioButton
{
static PURadioButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PURadioButton), new FrameworkPropertyMetadata(typeof(PURadioButton)));
}
#region Property
/// <summary>
/// 选择框样式,默认值为General。
/// </summary>
public RadioButtonStyles RadioButtonStyle
{
get { return (RadioButtonStyles)GetValue(RadioButtonStyleProperty); }
set { SetValue(RadioButtonStyleProperty, value); }
}
public static readonly DependencyProperty RadioButtonStyleProperty = DependencyProperty.Register("RadioButtonStyle", typeof(RadioButtonStyles), typeof(PURadioButton), new PropertyMetadata(RadioButtonStyles.General));
/// <summary>
/// 圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty = DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PURadioButton), new PropertyMetadata(new CornerRadius(0)));
/// <summary>
/// 内部选择框的宽度,默认值为20。
/// <para>Switch样式下默认值为30。</para>
/// </summary>
public double InnerWidth
{
get { return (double)GetValue(InnerWidthProperty); }
set
{ SetValue(InnerWidthProperty, value); }
}
public static readonly DependencyProperty InnerWidthProperty = DependencyProperty.Register("InnerWidth", typeof(double), typeof(PURadioButton), new PropertyMetadata((double)20));
/// <summary>
/// 内部选择框的高度,默认值为20。
/// </summary>
public double InnerHeight
{
get { return (double)GetValue(InnerHeightProperty); }
set { SetValue(InnerHeightProperty, value); }
}
public static readonly DependencyProperty InnerHeightProperty =
DependencyProperty.Register("InnerHeight", typeof(double), typeof(PURadioButton), new PropertyMetadata((double)20));
/// <summary>
/// Check时对号的背景颜色(或前景色),默认值为白色。
/// <para>仅当按钮样式为General时生效。</para>
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PURadioButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));
#endregion
}
}
================================================
FILE: Panuon.UI/8_ProgressBar/PUProgressBar.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace Panuon.UI
{
public class PUProgressBar : Control
{
static PUProgressBar()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUProgressBar), new FrameworkPropertyMetadata(typeof(PUProgressBar)));
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Loaded += delegate
{
PercentString = Percent * 100 + "%";
Change();
};
}
#region RoutedEvent
/// <summary>
/// 进度改变事件。
/// </summary>
public static readonly RoutedEvent PercentChangedEvent = EventManager.RegisterRoutedEvent("PercentChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<double>), typeof(PUProgressBar));
public event RoutedPropertyChangedEventHandler<double> PercentChanged
{
add { AddHandler(PercentChangedEvent, value); }
remove { RemoveHandler(PercentChangedEvent, value); }
}
internal void OnPercentChanged(double oldValue, double newValue)
{
RoutedPropertyChangedEventArgs<double> arg = new RoutedPropertyChangedEventArgs<double>(oldValue, newValue, PercentChangedEvent);
RaiseEvent(arg);
}
#endregion
#region Property
/// <summary>
/// 获取或设置进度条的基本样式。默认值为General。
/// </summary>
public ProgressBarStyles ProgressBarStyle
{
get { return (ProgressBarStyles)GetValue(ProgressBarStyleProperty); }
set { SetValue(ProgressBarStyleProperty, value); }
}
public static readonly DependencyProperty ProgressBarStyleProperty =
DependencyProperty.Register("ProgressBarStyle", typeof(ProgressBarStyles), typeof(PUProgressBar), new PropertyMetadata(ProgressBarStyles.General));
/// <summary>
/// 获取或设置进度条的填充动画持续时间。默认值为0.4秒。
/// </summary>
public TimeSpan AnimationDuration
{
get { return (TimeSpan)GetValue(AnimationDurationProperty); }
set { SetValue(AnimationDurationProperty, value); }
}
public static readonly DependencyProperty AnimationDurationProperty =
DependencyProperty.Register("AnimationDuration", typeof(TimeSpan), typeof(PUProgressBar), new PropertyMetadata(TimeSpan.FromSeconds(0.6)));
/// <summary>
/// 获取或设置进度条的填充颜色。默认值为灰黑色。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUProgressBar));
/// <summary>
/// 获取或设置进度条的圆角大小,默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUProgressBar));
/// <summary>
/// 获取或设置进度条填充方向,默认值为LeftToRight。
/// </summary>
public ProgressDirections ProgressDirection
{
get { return (ProgressDirections)GetValue(ProgressDirectionroperty); }
set { SetValue(ProgressDirectionroperty, value); }
}
public static readonly DependencyProperty ProgressDirectionroperty =
DependencyProperty.Register("ProgressDirection", typeof(ProgressDirections), typeof(PUProgressBar), new PropertyMetadata(ProgressDirections.LeftToRight));
/// <summary>
/// 获取或设置是否显示百分比。默认值为False。
/// </summary>
public bool IsPercentShow
{
get { return (bool)GetValue(IsPercentShowProperty); }
set { SetValue(IsPercentShowProperty, value); }
}
public static readonly DependencyProperty IsPercentShowProperty =
DependencyProperty.Register("IsPercentShow", typeof(bool), typeof(PUProgressBar));
/// <summary>
/// 获取或设置当前进度条的百分比,从0~1的值。默认值为0。
/// </summary>
public double Percent
{
get { return (double)GetValue(PercentProperty); }
set { SetValue(PercentProperty, value); }
}
public static readonly DependencyProperty PercentProperty =
DependencyProperty.Register("Percent", typeof(double), typeof(PUProgressBar), new PropertyMetadata(OnPercentChanged));
private static void OnPercentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var pgBar = d as PUProgressBar;
if (pgBar.Percent < 0)
{
pgBar.Percent = 0;
return;
}
else if (pgBar.Percent > 1)
{
pgBar.Percent = 1;
return;
}
pgBar.PercentString = pgBar.Percent * 100 + "%";
pgBar.OnPercentChanged((double)e.OldValue, (double)e.NewValue);
if (!pgBar.IsLoaded)
return;
pgBar.Change();
}
public new Thickness BorderThickness
{
get { return (Thickness)GetValue(BorderThicknessProperty); }
set { SetValue(BorderThicknessProperty, value); }
}
public new static readonly DependencyProperty BorderThicknessProperty =
DependencyProperty.Register("BorderThickness", typeof(Thickness), typeof(PUProgressBar), new PropertyMetadata(OnBorderThicknessChanged));
private static void OnBorderThicknessChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var bar = d as PUProgressBar;
bar.StrokeThickness = bar.BorderThickness.Left;
}
#endregion
#region Internal Property
internal string PercentString
{
get { return (string)GetValue(PercentStringProperty); }
set { SetValue(PercentStringProperty, value); }
}
internal static readonly DependencyProperty PercentStringProperty =
DependencyProperty.Register("PercentString", typeof(string), typeof(PUProgressBar));
internal double InnerWidth
{
get { return (double)GetValue(InnerWidthProperty); }
set { SetValue(InnerWidthProperty, value); }
}
internal static readonly DependencyProperty InnerWidthProperty =
DependencyProperty.Register("InnerWidth", typeof(double), typeof(PUProgressBar));
internal double InnerPercent
{
get { return (double)GetValue(InnerPercentProperty); }
set { SetValue(InnerPercentProperty, value); }
}
internal static readonly DependencyProperty InnerPercentProperty =
DependencyProperty.Register("InnerPercent", typeof(double), typeof(PUProgressBar));
internal double StrokeThickness
{
get { return (double)GetValue(StrokeThicknessProperty); }
set { SetValue(StrokeThicknessProperty, value); }
}
internal static readonly DependencyProperty StrokeThicknessProperty =
DependencyProperty.Register("StrokeThickness", typeof(double), typeof(PUProgressBar));
#endregion
#region Function
private void Change()
{
var toValue = ActualWidth * Percent;
if (ProgressDirection == ProgressDirections.TopToBottom || ProgressDirection == ProgressDirections.BottomToTop)
{
toValue = ActualHeight * Percent;
}
var anima = new DoubleAnimation()
{
To = toValue,
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut },
Duration = AnimationDuration,
};
BeginAnimation(InnerWidthProperty, anima);
var anima2 = new DoubleAnimation()
{
To = Percent,
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut },
Duration = AnimationDuration,
};
BeginAnimation(InnerPercentProperty, anima2);
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/Countdown.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
namespace Panuon.UI
{
public class Countdown : Control
{
#region Identity
private DispatcherTimer _timer;
#endregion
static Countdown()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(Countdown), new FrameworkPropertyMetadata(typeof(Countdown)));
}
public Countdown()
{
_timer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(1) };
_timer.Tick += CountdownTimer_Tick;
}
#region RoutedEvent
public static readonly RoutedEvent TimeChangedEvent = EventManager.RegisterRoutedEvent("TimeChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<int>), typeof(Countdown));
public event RoutedPropertyChangedEventHandler<int> TimeChanged
{
add { AddHandler(TimeChangedEvent, value); }
remove { RemoveHandler(TimeChangedEvent, value); }
}
void RaiseTimeChanged(int oldValue, int newValue)
{
var arg = new RoutedPropertyChangedEventArgs<int>(oldValue, newValue, TimeChangedEvent);
RaiseEvent(arg);
}
public static readonly RoutedEvent StopedEvent = EventManager.RegisterRoutedEvent("Stoped", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(Countdown));
public event RoutedEventHandler Stoped
{
add { AddHandler(StopedEvent, value); }
remove { RemoveHandler(StopedEvent, value); }
}
void RaiseStoped()
{
var arg = new RoutedEventArgs(StopedEvent);
RaiseEvent(arg);
}
#endregion
#region Property
public CornerRadius CornerRadius
{
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
}
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(Countdown));
public int Second
{
get { return (int)GetValue(SecondProperty); }
set { SetValue(SecondProperty, value); }
}
public static readonly DependencyProperty SecondProperty =
DependencyProperty.Register("Second", typeof(int), typeof(Countdown), new PropertyMetadata(OnSecondChanged));
private static void OnSecondChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var countDown = d as Countdown;
if(countDown.Second < 0)
{
countDown.Second = 0;
return;
}
countDown.RaiseTimeChanged(e.OldValue as int? ?? 0, e.NewValue as int? ?? 0);
}
public bool IsRunning
{
get { return (bool)GetValue(IsRunningProperty); }
set { SetValue(IsRunningProperty, value); }
}
public static readonly DependencyProperty IsRunningProperty =
DependencyProperty.Register("IsRunning", typeof(bool), typeof(Countdown), new PropertyMetadata(OnIsRunningChanged));
private static void OnIsRunningChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var countdown = d as Countdown;
if (countdown.IsRunning)
{
countdown._timer.Start();
}
else
{
countdown.RaiseStoped();
countdown._timer.Stop();
}
}
#endregion
#region Event
private void CountdownTimer_Tick(object sender, EventArgs e)
{
if (Second <= 0)
{
RaiseStoped();
_timer.Stop();
}
Second--;
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/DateTimePicker.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUDateTimeSelector : Control
{
#region Constructor
static PUDateTimeSelector()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUDateTimeSelector), new FrameworkPropertyMetadata(typeof(PUDateTimeSelector)));
}
public PUDateTimeSelector()
{
Loaded += delegate
{
UpdateText();
};
}
#endregion
#region Property
public DatePickerModes DatePickerMode
{
get { return (DatePickerModes)GetValue(DatePickerModeProperty); }
set { SetValue(DatePickerModeProperty, value); }
}
public static readonly DependencyProperty DatePickerModeProperty =
DependencyProperty.Register("DatePickerMode", typeof(DatePickerModes), typeof(PUDateTimeSelector), new PropertyMetadata(DatePickerModes.DateTime));
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(PUDateTimeSelector));
public Color ShadowColor
{
get { return (Color)GetValue(ShadowColorProperty); }
set { SetValue(ShadowColorProperty, value); }
}
public static readonly DependencyProperty ShadowColorProperty =
DependencyProperty.Register("ShadowColor", typeof(Color), typeof(PUDateTimeSelector));
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUDateTimeSelector));
public DateTime SelectedDateTime
{
get { return (DateTime)GetValue(SelectedDateTimeProperty); }
set { SetValue(SelectedDateTimeProperty, value); }
}
public static readonly DependencyProperty SelectedDateTimeProperty =
DependencyProperty.Register("SelectedDateTime", typeof(DateTime), typeof(PUDateTimeSelector), new PropertyMetadata(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0), OnSelectedDateTimeChanged));
private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var picker = d as PUDateTimeSelector;
picker.UpdateText();
}
public DateTime? MaxDate
{
get { return (DateTime?)GetValue(MaxDateProperty); }
set { SetValue(MaxDateProperty, value); }
}
public static readonly DependencyProperty MaxDateProperty =
DependencyProperty.Register("MaxDate", typeof(DateTime?), typeof(PUDateTimeSelector));
public DateTime? MinDate
{
get { return (DateTime?)GetValue(MinDateProperty); }
set { SetValue(MinDateProperty, value); }
}
public static readonly DependencyProperty MinDateProperty =
DependencyProperty.Register("MinDate", typeof(DateTime?), typeof(PUDateTimeSelector));
public CornerRadius CornerRadius
{
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
}
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(PUDateTimeSelector));
public object Icon
{
get { return (object)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(object), typeof(PUDateTimeSelector));
#endregion
#region Function
private void UpdateText()
{
switch (DatePickerMode)
{
case DatePickerModes.DateTime:
Text = SelectedDateTime.ToString("yyyy-MM-dd HH:mm:ss");
break;
case DatePickerModes.DateOnly:
Text = SelectedDateTime.ToString("yyyy-MM-dd");
break;
case DatePickerModes.TimeOnly:
Text = SelectedDateTime.ToString("HH:mm:ss");
break;
}
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/DropDown.cs
================================================
using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace Panuon.UI
{
public class DropDown : ContentControl
{
static DropDown()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DropDown), new FrameworkPropertyMetadata(typeof(DropDown)));
}
#region Property
public Color ShadowColor
{
get { return (Color)GetValue(ShadowColorProperty); }
set { SetValue(ShadowColorProperty, value); }
}
public static readonly DependencyProperty ShadowColorProperty =
DependencyProperty.Register("ShadowColor", typeof(Color), typeof(DropDown));
public UIElement Child
{
get { return (UIElement)GetValue(ChildProperty); }
set { SetValue(ChildProperty, value); }
}
public static readonly DependencyProperty ChildProperty =
DependencyProperty.Register("Child", typeof(UIElement), typeof(DropDown));
public DropDownPlacement DropDownPlacement
{
get { return (DropDownPlacement)GetValue(DropDownPlacementProperty); }
set { SetValue(DropDownPlacementProperty, value); }
}
public static readonly DependencyProperty DropDownPlacementProperty =
DependencyProperty.Register("DropDownPlacement", typeof(DropDownPlacement), typeof(DropDown), new PropertyMetadata(DropDownPlacement.LeftBottom));
public double CornerRadius
{
get { return (double)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
}
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register("CornerRadius", typeof(double), typeof(DropDown));
public bool IsOpen
{
get { return (bool)GetValue(IsOpenProperty); }
set { SetValue(IsOpenProperty, value); }
}
public static readonly DependencyProperty IsOpenProperty =
DependencyProperty.Register("IsOpen", typeof(bool), typeof(DropDown));
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUCard.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUCard : UserControl
{
#region Constructor
static PUCard()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUCard), new FrameworkPropertyMetadata(typeof(PUCard)));
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
AddHandler(PUButton.ClickEvent, new RoutedEventHandler(OnDetailButtonClicked));
}
private void OnDetailButtonClicked(object sender, RoutedEventArgs e)
{
var btnDetail = (sender as PUButton);
if (btnDetail == null || btnDetail.Tag == null || btnDetail.Tag.ToString() != "PART_Detail")
return;
OnDetail();
}
#endregion
#region RoutedEvent
/// <summary>
/// 点击详情事件。
/// </summary>
public static readonly RoutedEvent DetailEvent = EventManager.RegisterRoutedEvent("Detail", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUCard>), typeof(PUCard));
public event RoutedPropertyChangedEventHandler<PUCard> Detail
{
add { AddHandler(DetailEvent, value); }
remove { RemoveHandler(DetailEvent, value); }
}
internal void OnDetail()
{
RoutedPropertyChangedEventArgs<PUCard> arg = new RoutedPropertyChangedEventArgs<PUCard>(this, this, DetailEvent);
RaiseEvent(arg);
}
#endregion
#region Property
/// <summary>
/// 获取或设置是否显示详情按钮。默认值为False。
/// </summary>
public bool IsDetailButtonShow
{
get { return (bool)GetValue(IsDetailButtonShowProperty); }
set { SetValue(IsDetailButtonShowProperty, value); }
}
public static readonly DependencyProperty IsDetailButtonShowProperty =
DependencyProperty.Register("IsDetailButtonShow", typeof(bool), typeof(PUCard));
/// <summary>
/// 获取或设置标题的内容。默认值为Null。
/// </summary>
public object Header
{
get { return (object)GetValue(HeaderProperty); }
set { SetValue(HeaderProperty, value); }
}
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register("Header", typeof(object), typeof(PUCard));
/// <summary>
/// 获取或设置标题前的图标按钮。默认值为Null。
/// </summary>
public object Icon
{
get { return (object)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(object), typeof(PUCard));
/// <summary>
/// 获取或设置阴影颜色。默认值为透明。
/// </summary>
public Color ShadowColor
{
get { return (Color)GetValue(ShadowColorProperty); }
set { SetValue(ShadowColorProperty, value); }
}
public static readonly DependencyProperty ShadowColorProperty =
DependencyProperty.Register("ShadowColor", typeof(Color), typeof(PUCard));
/// <summary>
/// 获取或设置卡片的圆角大小。默认值为0。
/// </summary>
public CornerRadius BorderCornerRadius
{
get { return (CornerRadius)GetValue(BorderCornerRadiusProperty); }
set { SetValue(BorderCornerRadiusProperty, value); }
}
public static readonly DependencyProperty BorderCornerRadiusProperty =
DependencyProperty.Register("BorderCornerRadius", typeof(CornerRadius), typeof(PUCard));
/// <summary>
/// 获取或设置卡片的标题高度(包含标题和详情按钮)。默认值为30。
/// </summary>
public double HeaderHeight
{
get { return (double)GetValue(HeaderHeightProperty); }
set { SetValue(HeaderHeightProperty, value); }
}
public static readonly DependencyProperty HeaderHeightProperty =
DependencyProperty.Register("HeaderHeight", typeof(double), typeof(PUCard));
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUImageCuter.xaml
================================================
<UserControl x:Class="Panuon.UI.PUImageCuter"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Panuon.UI"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800"
x:Name="imagecuter">
<Grid Width="Auto"
Height="Auto">
<Image VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
SizeChanged="Img_SizeChanged"
Source="{Binding ImageSource,ElementName=imagecuter}"
Stretch="Uniform" />
<Canvas x:Name="CvaMain">
<local:PUResizeContainer x:Name="ResizeContainer"
Visibility="Hidden"
MinHeight="{Binding ImageMinHeight,ElementName=imagecuter}"
MinWidth="{Binding ImageMinWidth,ElementName=imagecuter}"
MaxHeight="{Binding ImageMaxHeight,ElementName=imagecuter}"
MaxWidth="{Binding ImageMaxWidth,ElementName=imagecuter}"
LimitInParent="True"
Canvas.Left="0"
Canvas.Top="0">
<Grid>
<Grid Background="#77DDDDDD">
<Grid>
<Rectangle StrokeThickness="1"
Stroke="#33AAAAAA"
StrokeDashArray="2,1"></Rectangle>
<Border Height="10"
Width="10"
VerticalAlignment="Top"
HorizontalAlignment="Left"
BorderThickness="2,2,0,0"
BorderBrush="#FFFFFF"></Border>
<Border Height="10"
Width="10"
VerticalAlignment="Top"
HorizontalAlignment="Right"
BorderThickness="0,2,2,0"
BorderBrush="#FFFFFF"></Border>
<Border Height="10"
Width="10"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
BorderThickness="2,0,0,2"
BorderBrush="#FFFFFF"></Border>
<Border Height="10"
Width="10"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
BorderThickness="0,0,2,2"
BorderBrush="#FFFFFF"></Border>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Rectangle StrokeThickness="0,1"
Grid.Row="1"
Stroke="#FFFFFF"
StrokeDashArray="2,1"></Rectangle>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle StrokeThickness="0,1"
Grid.Column="1"
Stroke="#FFFFFF"
StrokeDashArray="2,1"></Rectangle>
</Grid>
</Grid>
<local:DragableThumb DragTarget="{Binding Path=.,ElementName=ResizeContainer}"
LimitInParent="True" />
</Grid>
</local:PUResizeContainer>
</Canvas>
</Grid>
</UserControl>
================================================
FILE: Panuon.UI/9_Special/PUImageCuter.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Panuon.UI
{
/// <summary>
/// ImageCuter.xaml 的交互逻辑
/// </summary>
public partial class PUImageCuter : UserControl
{
public PUImageCuter()
{
InitializeComponent();
}
#region Property
public BitmapImage ImageSource
{
get { return (BitmapImage)GetValue(ImageSourceProperty); }
set { SetValue(ImageSourceProperty, value); }
}
public static readonly DependencyProperty ImageSourceProperty =
DependencyProperty.Register("ImageSource", typeof(BitmapImage), typeof(PUImageCuter));
public ImageType ImageType
{
get { return (ImageType)GetValue(ImageTypeProperty); }
set { SetValue(ImageTypeProperty, value); }
}
public static readonly DependencyProperty ImageTypeProperty =
DependencyProperty.Register("ImageType", typeof(ImageType), typeof(PUImageCuter), new PropertyMetadata(ImageType.Rectangle, OnImageTypeChanged));
private static void OnImageTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var cuter = d as PUImageCuter;
cuter.ResizeContainer.IsSquare = cuter.ImageType == ImageType.Square;
}
public double ImageMinHeight
{
get { return (double)GetValue(ImageMinHeightProperty); }
set { SetValue(ImageMinHeightProperty, value); }
}
public static readonly DependencyProperty ImageMinHeightProperty =
DependencyProperty.Register("ImageMinHeight", typeof(double), typeof(PUImageCuter), new PropertyMetadata(50.0));
public double ImageMinWidth
{
get { return (double)GetValue(ImageMinWidthProperty); }
set { SetValue(ImageMinWidthProperty, value); }
}
public static readonly DependencyProperty ImageMinWidthProperty =
DependencyProperty.Register("ImageMinWidth", typeof(double), typeof(PUImageCuter), new PropertyMetadata(50.0));
public double ImageMaxHeight
{
get { return (double)GetValue(ImageMaxHeightProperty); }
set { SetValue(ImageMaxHeightProperty, value); }
}
public static readonly DependencyProperty ImageMaxHeightProperty =
DependencyProperty.Register("ImageMaxHeight", typeof(double), typeof(PUImageCuter), new PropertyMetadata(double.NaN));
public double ImageMaxWidth
{
get { return (double)GetValue(ImageMaxWidthProperty); }
set { SetValue(ImageMaxWidthProperty, value); }
}
public static readonly DependencyProperty ImageMaxWidthProperty =
DependencyProperty.Register("ImageMaxWidth", typeof(double), typeof(PUImageCuter), new PropertyMetadata(double.NaN));
#endregion
#region Event
private void Img_SizeChanged(object sender, SizeChangedEventArgs e)
{
var image = sender as Image;
CvaMain.Width = image.ActualWidth;
CvaMain.Height = image.ActualHeight;
CvaMain.Margin = new Thickness((ActualWidth - image.ActualWidth) / 2, (ActualHeight - image.ActualHeight) / 2, (ActualWidth - image.ActualWidth) / 2, (ActualHeight - image.ActualHeight) / 2);
ResizeContainer.Visibility = Visibility.Visible;
}
#endregion
#region APIs
public BitmapSource GetCutedImage()
{
if (ImageSource == null)
return null;
var widthScale = ImageSource.PixelWidth / CvaMain.ActualWidth;
var heightScale = ImageSource.PixelHeight / CvaMain.ActualHeight;
return new CroppedBitmap(BitmapFrame.Create(ImageSource), new Int32Rect((int)(Canvas.GetLeft(ResizeContainer) * widthScale), (int)(Canvas.GetTop(ResizeContainer) * heightScale), (int)(ResizeContainer.ActualWidth * widthScale), (int)(ResizeContainer.ActualHeight * heightScale)));
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUIndicator.xaml
================================================
<UserControl x:Class="Panuon.UI.PUIndicator"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Panuon.UI"
mc:Ignorable="d"
MinHeight="10"
d:DesignHeight="20" d:DesignWidth="300"
SizeChanged="UserControl_SizeChanged"
BorderBrush="Gray"
Opacity="0.8">
<Grid>
<Border VerticalAlignment="Top"
HorizontalAlignment="Left"
x:Name="EllIndicator"></Border>
<StackPanel x:Name="StkMain"
Orientation="Horizontal">
</StackPanel>
</Grid>
</UserControl>
================================================
FILE: Panuon.UI/9_Special/PUIndicator.xaml.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace Panuon.UI
{
/// <summary>
/// PUIndicator.xaml 的交互逻辑
/// </summary>
public partial class PUIndicator : UserControl
{
public PUIndicator()
{
InitializeComponent();
Background = new SolidColorBrush(Colors.Transparent);
MouseEnter += delegate
{
var anima = new DoubleAnimation()
{
To = 1,
Duration = TimeSpan.FromSeconds(0.2),
};
this.BeginAnimation(OpacityProperty, anima);
};
MouseLeave += delegate
{
var anima = new DoubleAnimation()
{
To = 0.8,
Duration = TimeSpan.FromSeconds(0.2),
};
this.BeginAnimation(OpacityProperty, anima);
};
}
#region RoutedEvent
/// <summary>
/// 索引变更事件。
/// </summary>
public static readonly RoutedEvent IndexChangedEvent = EventManager.RegisterRoutedEvent("IndexChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<int>), typeof(PUIndicator));
public event RoutedPropertyChangedEventHandler<int> IndexChanged
{
add { AddHandler(IndexChangedEvent, value); }
remove { RemoveHandler(IndexChangedEvent, value); }
}
internal void OnIndexChanged(int oldValue, int newValue)
{
RoutedPropertyChangedEventArgs<int> arg = new RoutedPropertyChangedEventArgs<int>(oldValue, newValue, IndexChangedEvent);
RaiseEvent(arg);
}
#endregion
#region Property
/// <summary>
/// 排列方式,默认值为Horizontal(横向)。
/// <para>若排列方式为横向,需要设置控件的Height属性来计算球体大小;若排列方式为纵向,则需要设置控件的Width属性来计算球体大小。</para>
/// </summary>
public Orientation Dircetion
{
get { return (Orientation)GetValue(DircetionProperty); }
set { SetValue(DircetionProperty, value); }
}
public static readonly DependencyProperty DircetionProperty =
DependencyProperty.Register("Dircetion", typeof(Orientation), typeof(PUIndicator), new PropertyMetadata(Orientation.Horizontal, OnDircetionDircetionChanged));
private static void OnDircetionDircetionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var indicator = d as PUIndicator;
indicator.StkMain.Orientation = indicator.Dircetion;
}
/// <summary>
/// 指示小球的颜色,默认值为灰色。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUIndicator), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#666666"))));
/// <summary>
/// 索引总数。 默认值为1,最小值为1。
/// </summary>
public int TotalIndex
{
get { return (int)GetValue(TotalIndexProperty); }
set { SetValue(TotalIndexProperty, value); }
}
public static readonly DependencyProperty TotalIndexProperty =
DependencyProperty.Register("TotalIndex", typeof(int), typeof(PUIndicator), new PropertyMetadata(1));
/// <summary>
/// 当前索引。默认值为1,最小值为1。
/// </summary>
public int Index
{
get { return (int)GetValue(IndexProperty); }
set { SetValue(IndexProperty, value); }
}
public static readonly DependencyProperty IndexProperty =
DependencyProperty.Register("Index", typeof(int), typeof(PUIndicator), new PropertyMetadata(1, OnIndexChanged));
private static void OnIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var indicator = d as PUIndicator;
indicator.OnIndexChanged((int?)e.OldValue ?? 0, (int?)e.NewValue ?? 0);
if (!indicator.IsLoaded)
return;
indicator.ChangeIndex(true);
}
/// <summary>
/// 左右滑动动画的持续时间(单位:毫秒),若为0,则滑动时不使用动画。默认值为500毫秒。
/// </summary>
public int AnimationDuration
{
get { return (int)GetValue(AnimationDurationProperty); }
set { SetValue(AnimationDurationProperty, value); }
}
public static readonly DependencyProperty AnimationDurationProperty =
DependencyProperty.Register("AnimationDuration", typeof(int), typeof(PUIndicator), new PropertyMetadata(0));
#endregion
#region Private APIs
private void Draw()
{
if (TotalIndex < 1)
TotalIndex = 1;
var radius = 0.0;
if (Dircetion == Orientation.Horizontal)
radius = this.ActualHeight;
else
radius = this.ActualWidth;
StkMain.Children.Clear();
EllIndicator.Height = (int)(radius * 0.6);
EllIndicator.Width = (int)(radius * 0.6);
EllIndicator.Background = CoverBrush;
EllIndicator.CornerRadius = new CornerRadius(EllIndicator.Height / 2);
if (Dircetion == Orientation.Horizontal)
EllIndicator.Margin = new Thickness((radius - ((int)(radius * 0.6))) / 2, EllIndicator.Height / 2, 0, 0);
else
EllIndicator.Margin = new Thickness(EllIndicator.Height / 2, (radius - ((int)(radius * 0.6))) / 2, 0, 0);
EllIndicator.Opacity = 0.8;
EllIndicator.MouseEnter += delegate
{
var anima = new DoubleAnimation()
{
To = 1,
Duration = TimeSpan.FromSeconds(0.2),
};
EllIndicator.BeginAnimation(OpacityProperty, anima);
};
EllIndicator.MouseLeave += delegate
{
var anima = new DoubleAnimation()
{
To = 0.8,
Duration = TimeSpan.FromSeconds(0.2),
};
EllIndicator.BeginAnimation(OpacityProperty, anima);
};
for (int i = 1; i <= TotalIndex; i++)
{
var ellipse = new Border()
{
Margin = Dircetion == Orientation.Horizontal ? new Thickness(0, 0, (int)(radius * 0.3), 0) : new Thickness(0, 0, 0, (int)(radius * 0.3)),
Height = (int)radius,
Width = (int)radius,
CornerRadius = new CornerRadius(radius / 2),
BorderBrush = BorderBrush,
Background = new SolidColorBrush(Colors.Transparent),
BorderThickness = new Thickness(1),
Opacity = 0.6,
Tag = i,
Cursor = Cursors.Hand,
};
ellipse.MouseEnter += delegate
{
var anima = new DoubleAnimation()
{
To = 1,
Duration = TimeSpan.FromSeconds(0.2),
};
ellipse.BeginAnimation(OpacityProperty, anima);
};
ellipse.MouseLeave += delegate
{
var anima = new DoubleAnimation()
{
To = 0.6,
Duration = TimeSpan.FromSeconds(0.2),
};
ellipse.BeginAnimation(OpacityProperty, anima);
};
ellipse.MouseLeftButtonDown += delegate
{
Index = (int)ellipse.Tag;
};
StkMain.Children.Add(ellipse);
}
}
private void ChangeIndex(bool usingAnima)
{
var radius = 0.0;
if (Dircetion == Orientation.Horizontal)
radius = this.ActualHeight;
else
radius = this.ActualWidth;
var left = (Index - 1) * ((int)(radius * 1.3)) + (radius - ((int)(radius * 0.6))) / 2;
if (!usingAnima || AnimationDuration == 0)
{
if(Dircetion == Orientation.Horizontal)
EllIndicator.Margin = new Thickness(left, radius * 0.2, 0, 0);
else
EllIndicator.Margin = new Thickness(radius * 0.2, left, 0, 0);
}
else
{
if (Dircetion == Orientation.Horizontal)
{
var anima = new ThicknessAnimation()
{
To = new Thickness(left, radius * 0.2, 0, 0),
Duration = TimeSpan.FromMilliseconds(AnimationDuration),
EasingFunction = new CircleEase() { EasingMode = EasingMode.EaseInOut },
};
EllIndicator.BeginAnimation(MarginProperty, anima);
}
else
{
var anima = new ThicknessAnimation()
{
To = new Thickness(radius * 0.2, left, 0, 0),
Duration = TimeSpan.FromMilliseconds(AnimationDuration),
EasingFunction = new CircleEase() { EasingMode = EasingMode.EaseInOut },
};
EllIndicator.BeginAnimation(MarginProperty, anima);
}
}
}
#endregion
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
Draw();
ChangeIndex(false);
}
}
}
================================================
FILE: Panuon.UI/9_Special/PULoading.xaml
================================================
<UserControl x:Class="Panuon.UI.PULoading"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Panuon.UI"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Canvas x:Name="cvaMain">
</Canvas>
</UserControl>
================================================
FILE: Panuon.UI/9_Special/PULoading.xaml.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace Panuon.UI
{
/// <summary>
/// Loading.xaml 的交互逻辑
/// </summary>
public partial class PULoading : UserControl
{
private Storyboard _storyboard;
public PULoading()
{
InitializeComponent();
Loaded += PULoading_Loaded;
}
private void PULoading_Loaded(object sender, RoutedEventArgs e)
{
if (IsRunning)
Draw();
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
}
#region Property
public bool IsRunning
{
get { return (bool)GetValue(IsRunningProperty); }
set { SetValue(IsRunningProperty, value); }
}
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register("IsRunning", typeof(bool), typeof(PULoading), new PropertyMetadata(false, OnIsRunningChanged));
private static void OnIsRunningChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var load = d as PULoading;
if (!load.IsLoaded)
return;
var run = (bool)e.NewValue;
if (run)
load.Draw();
else
load.Clear();
}
#endregion
#region Internal APIs
internal void Draw()
{
_storyboard = new Storyboard()
{
RepeatBehavior = RepeatBehavior.Forever,
};
double canvasHeight = 0;
if (double.IsNaN(Height))
{
if (ActualHeight == 0)
{
return;
}
else
{
canvasHeight = ActualHeight;
}
}
else
{
canvasHeight = this.Height;
}
var ellipseHeight = canvasHeight * 0.1;
var rollHeight = canvasHeight * 0.75;
var rollRadius = rollHeight / 2;
for (int i = 0; i < 6; i++)
{
var ellipse = new Ellipse()
{
Fill = Foreground,
Width = ellipseHeight,
Height = ellipseHeight,
Margin = new Thickness(-ellipseHeight / 2, -ellipseHeight / 2, 0, 0),
Opacity = 0,
};
Canvas.SetTop(ellipse, canvasHeight * 0.125);
Canvas.SetLeft(ellipse, canvasHeight / 2);
var path = $"M{canvasHeight / 2},{canvasHeight * 0.125} A {rollRadius},{rollRadius} 0 0 1 {canvasHeight / 2},{rollHeight + canvasHeight * 0.125} A {rollRadius},{rollRadius} 0 0 1 {canvasHeight / 2},{canvasHeight * 0.125} A {rollRadius},{rollRadius} 0 0 1 {canvasHeight / 2},{rollHeight + canvasHeight * 0.125} A {rollRadius},{rollRadius} 0 0 1 {canvasHeight / 2},{canvasHeight * 0.125}";
var anima1 = GetDoubleAnimation(1, (i + i * 0.3) * 0.1, 0.01);
Storyboard.SetTarget(anima1, ellipse);
Storyboard.SetTargetProperty(anima1, new PropertyPath("Opacity"));
_storyboard.Children.Add(anima1);
var animaX = GetDoubleAnimationUsingPath(path, (i + i * 0.3) * 0.1, 1.5, PathAnimationSource.X);
Storyboard.SetTarget(animaX, ellipse);
Storyboard.SetTargetProperty(animaX, new PropertyPath("(Canvas.Left)"));
_storyboard.Children.Add(animaX);
var animaY = GetDoubleAnimationUsingPath(path, (i + i * 0.3) * 0.1, 1.5, PathAnimationSource.Y);
Storyboard.SetTarget(animaY, ellipse);
Storyboard.SetTargetProperty(animaY, new PropertyPath("(Canvas.Top)"));
_storyboard.Children.Add(animaY);
var anima2 = GetDoubleAnimation(0, 1.05 + 0.1 * i, 0.5);
Storyboard.SetTarget(anima2, ellipse);
Storyboard.SetTargetProperty(anima2, new PropertyPath("Opacity"));
_storyboard.Children.Add(anima2);
cvaMain.Children.Add(ellipse);
}
_storyboard.Begin();
}
internal void Clear()
{
_storyboard.Stop();
cvaMain.Children.Clear();
}
#endregion
#region Function
private DoubleAnimation GetDoubleAnimation(double to, double beginTime, double duration, IEasingFunction easingFunction = null)
{
return new DoubleAnimation()
{
To = to,
BeginTime = TimeSpan.FromSeconds(beginTime),
Duration = TimeSpan.FromSeconds(duration),
EasingFunction = easingFunction,
};
}
private DoubleAnimationUsingPath GetDoubleAnimationUsingPath(string path, double beginTime, double duration, PathAnimationSource source)
{
return new DoubleAnimationUsingPath()
{
BeginTime = TimeSpan.FromSeconds(beginTime),
PathGeometry = Geometry.Parse(path).GetFlattenedPathGeometry(),
Duration = TimeSpan.FromSeconds(duration),
Source = source,
};
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUMessageBox.xaml
================================================
<pu:PUWindow x:Class="Panuon.UI.PUMessageBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="clr-namespace:Panuon.UI"
mc:Ignorable="d"
Title="提示"
MinHeight="220"
MinWidth="350"
MaxWidth="500"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen"
FontSize="16"
ResizeMode="NoResize"
AllowAutoCoverMask="True"
NavButtonVisibility="Hidden">
<pu:PUWindow.Icon>
<TextBlock Text=""
FontSize="20"
FontFamily="{DynamicResource IconFont}"></TextBlock>
</pu:PUWindow.Icon>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
</Grid.RowDefinitions>
<Label Margin="20,0"
HorizontalContentAlignment="Center"
FontSize="16"
VerticalContentAlignment="Center">
<TextBlock x:Name="txtContent"
TextWrapping="Wrap"
Text="" />
</Label>
<Grid x:Name="grdAwait">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="1.4*" />
</Grid.ColumnDefinitions>
<pu:PULoading x:Name="loading"
Width="40"
Height="40"
HorizontalAlignment="Right"
Margin="0,0,15,0" />
<Grid Grid.Column="1">
<TextBlock Margin="10,0"
VerticalAlignment="Center"
x:Name="txtAwait"
TextWrapping="Wrap"
Text="" />
</Grid>
</Grid>
<Grid Grid.Row="1"
x:Name="groupTip">
<pu:PUButton x:Name="btnOK"
Margin="30,0,30,0"
Height="35"
Content="好"
Click="PUButton_Click"></pu:PUButton>
</Grid>
<Grid Grid.Row="1"
x:Name="groupConfirm"
Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<pu:PUButton x:Name="BtnYes"
Margin="20,0,10,0"
Height="35"
Content="是"
Click="PUButtonYes_Click"></pu:PUButton>
<pu:PUButton x:Name="BtnNo"
Margin="10,0,20,0"
Height="35"
Grid.Column="1"
ButtonStyle="Outline"
Foreground="DimGray"
BorderBrush="DimGray"
CoverBrush="DimGray"
Content="取消"
Click="PUButtonNo_Click"></pu:PUButton>
</Grid>
</Grid>
</pu:PUWindow>
================================================
FILE: Panuon.UI/9_Special/PUMessageBox.xaml.cs
================================================
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
namespace Panuon.UI
{
/// <summary>
/// PUMessageBox.xaml 的交互逻辑
/// </summary>
public partial class PUMessageBox : UI.PUWindow
{
#region Identity
RoutedEventHandler _cancel;
static PUMessageBox _instance;
#endregion
private PUMessageBox(string title, string content, bool isConfirm, bool showInTaskBar, AnimationStyles animateStyle)
{
InitializeComponent();
Title = title;
txtContent.Text = content;
if (isConfirm)
{
groupTip.Visibility = Visibility.Collapsed;
groupConfirm.Visibility = Visibility.Visible;
}
ShowInTaskbar = showInTaskBar;
AnimationStyle = animateStyle;
if(Owner != null)
{
WindowStartupLocation = WindowStartupLocation.CenterOwner;
}
}
#region APIs
/// <summary>
/// 打开一个消息提示对话框,并打开父窗体的遮罩层。
/// </summary>
/// <param name="content">要显示的内容。</param>
/// <param name="title">标题内容。</param>
/// <param name="buttons">按钮内容,默认为“好”</param>
/// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param>
public static void ShowDialog(string content, string title = "提示", Buttons buttons = Buttons.Sure, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale)
{
var mbox = new PUMessageBox(title, content, false, showInTaskBar, animateStyle);
mbox.CheckButtonContent(buttons);
if (!showInTaskBar)
mbox.ShowInTaskbar = false;
mbox.ShowDialog();
}
/// <summary>
/// 打开一个消息确认对话框,并打开父窗体的遮罩层。
/// </summary>
/// <param name="content">要显示的内容。</param>
/// <param name="title">标题内容。</param>
/// <param name="buttons">按钮内容,默认为“是/否”</param>
/// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param>
public static bool? ShowConfirm(string content, string title = "提示", Buttons buttons = Buttons.YesOrNo, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale)
{
var mbox = new PUMessageBox(title, content, true, showInTaskBar, animateStyle);
mbox.CheckButtonContent(buttons);
if (!showInTaskBar)
mbox.ShowInTaskbar = false;
mbox.ShowDialog();
return mbox.DialogResult;
}
/// <summary>
/// 打开一个等待界面,并打开父窗体的遮罩层。该界面将以Show的方式打开,但用户不能使用Alt+F4强制关闭此页面。若要关闭此界面,请调用PUMessageBox.CloseAwait()方法。
/// </summary>
/// <param name="content">要显示的内容</param>
public static void ShowAwait(string content)
{
var mbox = new PUMessageBox("", "", false, false, AnimationStyles.Scale);
mbox.AllowForcingClose = false;
_instance = mbox;
mbox.txtAwait.Text = content;
mbox.btnOK.IsEnabled = false;
mbox.CheckButtonContent(Buttons.Cancel);
mbox.Topmost = true;
mbox.loading.IsRunning = true;
mbox.grdAwait.Visibility = Visibility.Visible;
mbox.Show();
}
/// <summary>
/// 打开一个等待界面,并打开父窗体的遮罩层。该界面将以Show的方式打开,但用户不能使用Alt+F4强制关闭此页面。若要关闭此界面,请调用PUMessageBox.CloseAwait()方法。
/// </summary>
/// <param name="content">要显示的内容</param>
/// <param name="cancelCallback">若允许用户取消等待,则必须指定点击取消按钮后的后续处理。用户点击了取消按钮,该窗体需要您手动关闭。若不指定后续处理,取消按钮将被禁用。</param>
public static void ShowAwait(string content, RoutedEventHandler cancelCallback = null)
{
var mbox = new PUMessageBox("", "", false, false, AnimationStyles.Scale);
mbox.AllowForcingClose = false;
_instance = mbox;
mbox.txtAwait.Text = content;
mbox.CheckButtonContent(Buttons.Cancel);
mbox._cancel = cancelCallback;
mbox.Topmost = true;
mbox.loading.IsRunning = true;
mbox.grdAwait.Visibility = Visibility.Visible;
mbox.Show();
}
/// <summary>
/// 打开一个等待界面,并打开父窗体的遮罩层。该界面将以Show的方式打开,但用户不能使用Alt+F4强制关闭此页面。若要关闭此界面,请调用PUMessageBox.CloseAwait()方法。
/// </summary>
/// <param name="content">要显示的内容</param>
/// <param name="title">标题内容。</param>
/// <param name="cancelCallback">若允许用户取消等待,则必须指定点击取消按钮后的后续处理。用户点击了取消按钮,该窗体需要您手动关闭。若不指定后续处理,取消按钮将被禁用。</param>
public static void ShowAwait(string content, string title = "提示", RoutedEventHandler cancelCallback = null, AnimationStyles animateStyle = AnimationStyles.Scale)
{
var mbox = new PUMessageBox(title, "", false, false, animateStyle);
mbox.AllowForcingClose = false;
_instance = mbox;
mbox.CheckButtonContent(Buttons.Cancel);
mbox._cancel = cancelCallback;
mbox.Topmost = true;
mbox.grdAwait.Visibility = Visibility.Visible;
mbox.loading.IsRunning = true;
mbox.txtAwait.Text = content;
mbox.Show();
}
/// <summary>
/// 尝试关闭最后打开的一个等待界面。
/// 若要在其关闭之后立即打开另一个PUMessageBox,请使用另一个重载方法,或等待400ms后再打开。
/// </summary>
public static void CloseAwait()
{
if (_instance != null)
{
_instance.Closed += delegate
{
_instance = null;
};
_instance.Close();
}
}
/// <summary>
/// 尝试关闭最后打开的一个等待界面。
/// 若要关闭之后立即打开另一个PUMessageBox,请指定关闭事件后的回调处理。
/// <param name="closedCallback"></param>
public static void CloseAwait(EventHandler closedCallback)
{
if (_instance != null)
{
_instance.Closed += delegate
{
_instance = null;
closedCallback(null, null);
};
_instance.Close();
}
}
#endregion
#region Sys
private void CheckButtonContent(Buttons buttons)
{
switch (buttons)
{
case Buttons.Sure:
btnOK.Content = "好";
break;
case Buttons.Yes:
btnOK.Content = "是";
break;
case Buttons.OK:
btnOK.Content = "确定";
break;
case Buttons.Cancel:
btnOK.Content = "取消";
break;
case Buttons.YesOrNo:
BtnYes.Content = "是";
BtnNo.Content = "否";
break;
case Buttons.YesOrCancel:
BtnYes.Content = "是";
BtnNo.Content = "取消";
break;
case Buttons.OKOrCancel:
BtnYes.Content = "确定";
BtnNo.Content = "取消";
break;
case Buttons.AcceptOrRefused:
BtnYes.Content = "接受";
BtnNo.Content = "拒绝";
break;
case Buttons.AcceptOrCancel:
BtnYes.Content = "接受";
BtnNo.Content = "取消";
break;
}
}
private void PUButton_Click(object sender, RoutedEventArgs e)
{
if (_cancel != null)
{
txtAwait.Text = "正在取消";
btnOK.IsEnabled = false;
loading.IsRunning = false;
_cancel(null, null);
}
else
{
Close();
}
}
private void PUButtonYes_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
}
private void PUButtonNo_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUSlideShow.xaml
================================================
<UserControl x:Class="Panuon.UI.PUSlideShow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Panuon.UI"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300"
SizeChanged="UserControl_SizeChanged">
<Grid>
<VirtualizingStackPanel x:Name="PART_STKMAIN"
VirtualizationMode="Recycling"
Orientation="Horizontal">
</VirtualizingStackPanel>
<local:PUButton x:Name="PART_BTNLEFT"
Content=""
FontFamily="{DynamicResource IconFont}"
ButtonStyle="Hollow"
Width="35"
Height="35"
HorizontalAlignment="Left"
Margin="20,0,0,0"
BorderCornerRadius="17.5"
Click="BtnLeft_Click"></local:PUButton>
<local:PUButton x:Name="PART_BTNRIGHT"
Content=""
FontFamily="{DynamicResource IconFont}"
ButtonStyle="Hollow"
Width="35"
Height="35"
HorizontalAlignment="Right"
Margin="0,0,20,0"
BorderCornerRadius="17.5"
Click="BtnRight_Click"></local:PUButton>
<local:PUIndicator x:Name="PART_INDICATOR"
Height="14"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Margin="0,0,0,20"></local:PUIndicator>
</Grid>
</UserControl>
================================================
FILE: Panuon.UI/9_Special/PUSlideShow.xaml.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace Panuon.UI
{
/// <summary>
/// PUSlideShow.xaml 的交互逻辑
/// </summary>
[ContentProperty(nameof(Content))]
public partial class PUSlideShow : UserControl
{
#region Identity
private bool isFirstTime = true;
#endregion
public PUSlideShow()
{
InitializeComponent();
Content = PART_STKMAIN.Children;
PART_INDICATOR.IndexChanged += delegate
{
Index = PART_INDICATOR.Index;
};
if (Index == 1 && !Recyclable)
PART_BTNLEFT.IsEnabled = false;
else
PART_BTNLEFT.IsEnabled = true;
if (Index == Content.Count && !Recyclable)
PART_BTNRIGHT.IsEnabled = false;
else
PART_BTNRIGHT.IsEnabled = true;
PART_INDICATOR.AnimationDuration = AnimationDuration;
}
#region Property
public new UIElementCollection Content
{
get { return (UIElementCollection)GetValue(ContentProperty); }
set { SetValue(ContentProperty, value); }
}
public new static readonly DependencyProperty ContentProperty =
DependencyProperty.Register("Content", typeof(UIElementCollection), typeof(PUSlideShow), new PropertyMetadata(OnContentChanged));
private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
if (!slideShow.IsLoaded || slideShow.Content == null)
return;
slideShow.Draw();
slideShow.PART_INDICATOR.TotalIndex = slideShow.Content.Count;
}
/// <summary>
/// 索引,表示当前的位置。从1开始。
/// <para>当你试图将Index的值设置为大于Content数量上限或小于1的数字时,Index会被重设为Content的数量或1
/// (若Recyclable为True,则会被重设为1或Content的数量)。</para>
/// </summary>
public int Index
{
get { return (int)GetValue(IndexProperty); }
set { SetValue(IndexProperty, value); }
}
public static readonly DependencyProperty IndexProperty =
DependencyProperty.Register("Index", typeof(int), typeof(PUSlideShow), new PropertyMetadata(1, OnIndexChanged));
private static void OnIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
if (!slideShow.IsLoaded || slideShow.Content == null)
return;
slideShow.PART_INDICATOR.Index = slideShow.Index;
slideShow.ChangeIndex();
}
/// <summary>
/// 滑动方向。默认值为Horizontal(横向)。
/// </summary>
public Orientation SlideDirection
{
get { return (Orientation)GetValue(SlideDirectionProperty); }
set { SetValue(SlideDirectionProperty, value); }
}
public static readonly DependencyProperty SlideDirectionProperty =
DependencyProperty.Register("SlideDirection", typeof(Orientation), typeof(PUSlideShow), new PropertyMetadata(Orientation.Horizontal, OnSlideDirectionChanged));
private static void OnSlideDirectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
slideShow.PART_STKMAIN.Orientation = slideShow.SlideDirection;
if (slideShow.SlideDirection == Orientation.Horizontal)
{
slideShow.PART_BTNLEFT.Content = "";
slideShow.PART_BTNRIGHT.Content = "";
slideShow.PART_BTNLEFT.VerticalAlignment = VerticalAlignment.Center;
slideShow.PART_BTNLEFT.HorizontalAlignment = HorizontalAlignment.Left;
slideShow.PART_BTNRIGHT.VerticalAlignment = VerticalAlignment.Center;
slideShow.PART_BTNRIGHT.HorizontalAlignment = HorizontalAlignment.Right;
slideShow.PART_BTNLEFT.Margin = new Thickness(20, 0, 0, 0);
slideShow.PART_BTNRIGHT.Margin = new Thickness(0, 0, 20, 0);
slideShow.PART_INDICATOR.Dircetion = Orientation.Horizontal;
slideShow.PART_INDICATOR.Height = 15;
slideShow.PART_INDICATOR.Width = double.NaN;
slideShow.PART_INDICATOR.VerticalAlignment = VerticalAlignment.Bottom;
slideShow.PART_INDICATOR.HorizontalAlignment = HorizontalAlignment.Center;
slideShow.PART_INDICATOR.Margin = new Thickness(0, 0, 0, 20);
}
else
{
slideShow.PART_BTNLEFT.Content = "";
slideShow.PART_BTNRIGHT.Content = "";
slideShow.PART_BTNLEFT.VerticalAlignment = VerticalAlignment.Top;
slideShow.PART_BTNLEFT.HorizontalAlignment = HorizontalAlignment.Center;
slideShow.PART_BTNRIGHT.VerticalAlignment = VerticalAlignment.Bottom;
slideShow.PART_BTNRIGHT.HorizontalAlignment = HorizontalAlignment.Center;
slideShow.PART_BTNLEFT.Margin = new Thickness(0, 20, 0, 0);
slideShow.PART_BTNRIGHT.Margin = new Thickness(0, 0, 0, 20);
slideShow.PART_INDICATOR.Dircetion = Orientation.Vertical;
slideShow.PART_INDICATOR.Height = double.NaN;
slideShow.PART_INDICATOR.Width =15 ;
slideShow.PART_INDICATOR.VerticalAlignment = VerticalAlignment.Center;
slideShow.PART_INDICATOR.HorizontalAlignment = HorizontalAlignment.Left;
slideShow.PART_INDICATOR.Margin = new Thickness(20, 0, 0, 0);
}
}
/// <summary>
/// 是否显示左右滑动按钮。
/// </summary>
public bool IsSlideButtonShow
{
get { return (bool)GetValue(IsSlideButtonShowProperty); }
set { SetValue(IsSlideButtonShowProperty, value); }
}
public static readonly DependencyProperty IsSlideButtonShowProperty =
DependencyProperty.Register("IsSlideButtonShow", typeof(bool), typeof(PUSlideShow), new PropertyMetadata(true, OnIsSlideButtonShowChanged));
private static void OnIsSlideButtonShowChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
if (slideShow.IsSlideButtonShow)
{
slideShow.PART_BTNLEFT.Visibility = Visibility.Visible;
slideShow.PART_BTNRIGHT.Visibility = Visibility.Visible;
}
else
{
slideShow.PART_BTNLEFT.Visibility = Visibility.Collapsed;
slideShow.PART_BTNRIGHT.Visibility = Visibility.Collapsed;
}
}
/// <summary>
/// 滑动按钮的颜色,默认为灰黑色。
/// </summary>
public Brush SlideButtonBrush
{
get { return (Brush)GetValue(SlideButtonBrushProperty); }
set { SetValue(SlideButtonBrushProperty, value); }
}
public static readonly DependencyProperty SlideButtonBrushProperty =
DependencyProperty.Register("SlideButtonBrush", typeof(Brush), typeof(PUSlideShow), new PropertyMetadata(OnSlideButtonBrushChanged));
private static void OnSlideButtonBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
if (slideShow.SlideButtonBrush != null)
{
slideShow.PART_BTNLEFT.Foreground = slideShow.SlideButtonBrush;
slideShow.PART_BTNLEFT.Background = slideShow.SlideButtonBrush;
slideShow.PART_BTNLEFT.CoverBrush = slideShow.SlideButtonBrush;
slideShow.PART_BTNRIGHT.Foreground = slideShow.SlideButtonBrush;
slideShow.PART_BTNRIGHT.Background = slideShow.SlideButtonBrush;
slideShow.PART_BTNRIGHT.CoverBrush = slideShow.SlideButtonBrush;
}
}
/// <summary>
/// 左右滑动动画的持续时间(单位:毫秒),若为0,则滑动时不使用动画。默认值为500毫秒。
/// </summary>
public int AnimationDuration
{
get { return (int)GetValue(AnimationDurationProperty); }
set { SetValue(AnimationDurationProperty, value); }
}
public static readonly DependencyProperty AnimationDurationProperty =
DependencyProperty.Register("AnimationDuration", typeof(int), typeof(PUSlideShow), new PropertyMetadata(500, OnAnimationDurationChanged));
private static void OnAnimationDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
slideShow.PART_INDICATOR.AnimationDuration = slideShow.AnimationDuration;
}
/// <summary>
/// 是否允许滑动无限循环。
/// </summary>
public bool Recyclable
{
get { return (bool)GetValue(RecyclableProperty); }
set { SetValue(RecyclableProperty, value); }
}
public static readonly DependencyProperty RecyclableProperty =
DependencyProperty.Register("Recyclable", typeof(bool), typeof(PUSlideShow), new PropertyMetadata(false));
/// <summary>
/// 是否显示指示器。
/// </summary>
public bool IsIndicatorShow
{
get { return (bool)GetValue(IsIndicatorShowProperty); }
set { SetValue(IsIndicatorShowProperty, value); }
}
public static readonly DependencyProperty IsIndicatorShowProperty =
DependencyProperty.Register("IsIndicatorShow", typeof(bool), typeof(PUSlideShow), new PropertyMetadata(true, OnIsIndicatorShowChanged));
private static void OnIsIndicatorShowChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slide = d as PUSlideShow;
if (slide.IsIndicatorShow)
slide.PART_INDICATOR.Visibility = Visibility.Visible;
else
slide.PART_INDICATOR.Visibility = Visibility.Hidden;
}
/// <summary>
/// 指示器颜色。
/// </summary>
public Brush IndicatorBrush
{
get { return (Brush)GetValue(IndicatorBrushProperty); }
set { SetValue(IndicatorBrushProperty, value); }
}
public static readonly DependencyProperty IndicatorBrushProperty =
DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(PUSlideShow), new PropertyMetadata(new SolidColorBrush(Colors.DimGray), OnIndicatorBrushChanged));
private static void OnIndicatorBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var slideShow = d as PUSlideShow;
slideShow.PART_INDICATOR.BorderBrush = slideShow.IndicatorBrush;
slideShow.PART_INDICATOR.CoverBrush = slideShow.IndicatorBrush;
}
#endregion
#region APIs
private void Draw()
{
PART_INDICATOR.TotalIndex = Content.Count;
foreach (var item in Content)
{
var grid = item as FrameworkElement;
grid.Width = ActualWidth;
grid.Height = ActualHeight;
}
}
private void ChangeIndex()
{
if (Index < 1)
{
if (!Recyclable)
{
Index = 1;
return;
}
else
{
Index = Content.Count;
return;
}
}
else if (Index > Content.Count)
{
if (!Recyclable)
{
Index = Content.Count;
return;
}
else
{
Index = 1;
return;
}
}
if (Index == 1 && !Recyclable)
PART_BTNLEFT.IsEnabled = false;
else
PART_BTNLEFT.IsEnabled = true;
if (Index == Content.Count && !Recyclable)
PART_BTNRIGHT.IsEnabled = false;
else
PART_BTNRIGHT.IsEnabled = true;
if (isFirstTime || AnimationDuration == 0)
{
if (SlideDirection == Orientation.Horizontal)
PART_STKMAIN.Margin = new Thickness(-1 * (Index - 1) * ActualWidth, 0, 0, 0);
else
PART_STKMAIN.Margin = new Thickness(0, -1 * (Index - 1) * ActualHeight, 0, 0);
}
else
{
if (SlideDirection == Orientation.Horizontal)
{
var anima = new ThicknessAnimation()
{
To = new Thickness(-1 * (Index - 1) * ActualWidth, 0, 0, 0),
Duration = TimeSpan.FromMilliseconds(AnimationDuration),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut },
};
PART_STKMAIN.BeginAnimation(MarginProperty, anima);
}
else
{
var anima = new ThicknessAnimation()
{
To = new Thickness(0, -1 * (Index - 1) * ActualHeight, 0, 0),
Duration = TimeSpan.FromMilliseconds(AnimationDuration),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut },
};
PART_STKMAIN.BeginAnimation(MarginProperty, anima);
}
}
isFirstTime = false;
}
#endregion
#region Sys
private void BtnLeft_Click(object sender, RoutedEventArgs e)
{
Index--;
}
private void BtnRight_Click(object sender, RoutedEventArgs e)
{
Index++;
}
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
Draw();
ChangeIndex();
}
#endregion
}
}
================================================
FILE: Panuon.UI/9_Special/PUSplitLine.cs
================================================
using System.Windows;
using System.Windows.Controls;
namespace Panuon.UI
{
public class PUSplitLine : Control
{
static PUSplitLine()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUSplitLine), new FrameworkPropertyMetadata(typeof(PUSplitLine)));
}
#region Property
/// <summary>
/// 分割线的停靠方向,默认为Bottom(底部)。
/// </summary>
public Alignments Alignment
{
get { return (Alignments)GetValue(AlignmentProperty); }
set { SetValue(AlignmentProperty, value); }
}
public static readonly DependencyProperty AlignmentProperty =
DependencyProperty.Register("Alignment", typeof(Alignments), typeof(PUSplitLine), new PropertyMetadata(Alignments.Bottom));
public enum Alignments
{
Left,Top,Right,Bottom
}
#endregion
}
}
================================================
FILE: Panuon.UI/A0_TreeView/PUTreeView.cs
================================================
using Panuon.UI.Utils;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Panuon.UI
{
public class PUTreeView : TreeView
{
static PUTreeView()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PUTreeView), new FrameworkPropertyMetadata(typeof(PUTreeView)));
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
}
#region Event
/// <summary>
/// 选择了新项目事件。
/// </summary>
public static readonly RoutedEvent ChoosedItemChangedEvent = EventManager.RegisterRoutedEvent("ChoosedItemChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<PUTreeViewItem>), typeof(PUTreeView));
public event RoutedPropertyChangedEventHandler<PUTreeViewItem> ChoosedItemChanged
{
add { AddHandler(ChoosedItemChangedEvent, value); }
remove { RemoveHandler(ChoosedItemChangedEvent, value); }
}
internal void OnChoosedItemChanged(PUTreeViewItem oldItem, PUTreeViewItem newItem)
{
RoutedPropertyChangedEventArgs<PUTreeViewItem> arg = new RoutedPropertyChangedEventArgs<PUTreeViewItem>(oldItem, newItem, ChoosedItemChangedEvent); RaiseEvent(arg);
}
#endregion
#region Property
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("该属性对此控件无效。请使用BindingItems属性替代。", true)]
public new IEnumerable ItemsSource
{
get { return (IEnumerable)GetValue(ItemsSourceProperty); }
private set { SetValue(ItemsSourceProperty, value); }
}
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("该属性对此控件无效。请该用ChoosedValuePath属性替代。", true)]
public new string SelectedValuePath
{
get { return base.SelectedValuePath; }
private set { base.SelectedValuePath = value; }
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ObsoleteAttribute("该属性对此控件无效。请该用ChoosedValue属性替代。", true)]
public new object SelectedValue
{
get { return base.SelectedValue; }
}
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("该属性对此控件无效。BindingItems属性中的Header属性即为要显示的内容。", true)]
public new string DisplayMemberPath
{
get { return base.DisplayMemberPath; }
private set { base.DisplayMemberPath = value; }
}
/// <summary>
/// 获取或设置树视图的基本样式,默认值为General。
/// </summary>
public TreeViewStyles TreeViewStyle
{
get { return (TreeViewStyles)GetValue(TreeViewStyleProperty); }
set { SetValue(TreeViewStyleProperty, value); }
}
public static readonly DependencyProperty TreeViewStyleProperty =
DependencyProperty.Register("TreeViewStyle", typeof(TreeViewStyles), typeof(PUTreeView), new PropertyMetadata(TreeViewStyles.General));
/// <summary>
/// 获取或设置子项目的单行元素高度,默认值为40。
/// </summary>
public double InnerHeight
{
get { return (double)GetValue(InnerHeightProperty); }
set { SetValue(InnerHeightProperty, value); }
}
public static readonly DependencyProperty InnerHeightProperty =
DependencyProperty.Register("InnerHeight", typeof(double), typeof(PUTreeView), new PropertyMetadata((double)40));
/// <summary>
/// 获取或设置鼠标悬浮时遮罩层的背景颜色,默认值为#22666666。
/// </summary>
public Brush CoverBrush
{
get { return (Brush)GetValue(CoverBrushProperty); }
set { SetValue(CoverBrushProperty, value); }
}
public static readonly DependencyProperty CoverBrushProperty =
DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PUTreeView));
/// <summary>
/// 鼠标悬浮时遮罩层的背景颜色,默认值为#44666666。
/// </summary>
public Brush ChoosedBrush
{
get { return (Brush)GetValue(ChoosedBrushProperty); }
set { SetValue(ChoosedBrushProperty, value); }
}
public static readonly DependencyProperty ChoosedBrushProperty =
DependencyProperty.Register("ChoosedBrush", typeof(Brush), typeof(PUTreeView));
/// <summary>
/// 获取被选中的元素。
/// </summary>
public PUTreeViewItem ChoosedItem
{
get { return (PUTreeViewItem)GetValue(ChoosedItemProperty); }
internal set { SetValue(ChoosedItemProperty, value); }
}
public static readonly DependencyProperty ChoosedItemProperty =
DependencyProperty.Register("ChoosedItem", typeof(PUTreeViewItem), typeof(PUTreeView), new PropertyMetadata(OnChoosedItemChanged));
private static void OnChoosedItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var treeView = d as PUTreeView;
if (treeView.ChoosedItem == null)
{
treeView.ChoosedValue = null;
}
else
{
var value = treeView.ChoosedValuePath == ChoosedValuePaths.Header ? treeView.ChoosedItem.Header : treeView.ChoosedItem.Value;
if (treeView.ChoosedValue != value)
{
treeView.isInternalSetChoosedValue = true;
treeView.ChoosedValue = value;
}
}
treeView.OnChoosedItemChanged(e.OldValue as PUTreeViewItem, e.NewValue as PUTreeViewItem);
}
/// <summary>
/// 获取或设置是否需要展开父项的方式,默认为Click。
/// </summary>
public ExpandModes ExpandMode
{
get { return (ExpandModes)GetValue(ExpandModeProperty); }
set { SetValue(ExpandModeProperty, value); }
}
public static readonly DependencyProperty ExpandModeProperty =
DependencyProperty.Register("ExpandMode", typeof(ExpandModes), typeof(PUTreeView), new PropertyMetadata(ExpandModes.Click));
/// <summary>
/// 该属性指定了当子项目被选中时,ChoosedValue应呈现子项目的哪一个值。
/// 可选项为Header或Value,默认值为Header。
/// </summary>
public ChoosedValuePaths ChoosedValuePath
{
get { return (ChoosedValuePaths)GetValue(ChoosedValuePathProperty); }
set { SetValue(ChoosedValuePathProperty, value); }
}
public static readonly DependencyProperty ChoosedValuePathProperty =
DependencyProperty.Register("ChoosedValuePath", typeof(ChoosedValuePaths), typeof(PUTreeView), new PropertyMetadata(ChoosedValuePaths.Header));
/// <summary>
/// 获取被选中PUTreeViewItem的Header或Value属性(这取决于SelectedValuePath),
/// 或根据设置的ChoosedValue来选中子项目。
/// </summary>
public object ChoosedValue
{
get { return (object)GetValue(ChoosedValueProperty); }
set { SetValue(ChoosedValueProperty, value); }
}
public static readonly DependencyProperty ChoosedValueProperty =
DependencyProperty.Register("ChoosedValue", typeof(object), typeof(PUTreeView), new PropertyMetadata(OnChoosedValueChanged));
internal bool isInternalSetChoosedValue = false;
private static void OnChoosedValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var treeView = d as PUTreeView;
if (treeView.ChoosedValue == null)
return;
if (treeView.isInternalSetChoosedValue)
{
treeView.isInternalSetChoosedValue = false;
return;
}
var tvi = treeView.ChoosedValuePath == ChoosedValuePaths.Header ? treeView.GetItemByHeader(treeView.ChoosedValue, true, false) : treeView.GetItemByValue(treeView.ChoosedValue, true, false);
if (tvi != null)
{
if (!tvi.IsChoosed)
tvi.IsChoosed = true;
}
else
{
if (treeView.ChoosedItem != null)
{
treeView.ChoosedItem.IsChoosed = false;
treeView.ChoosedItem = null;
}
}
}
/// <summary>
/// 用于TreeView的绑定。
/// </summary>
public ObservableCollection<PUTreeViewItemModel> BindingItems
{
get { return (ObservableCollection<PUTreeViewItemModel>)GetValue(BindingItemsProperty); }
set { SetValue(BindingItemsProperty, value); }
}
public static readonly DependencyProperty BindingItemsProperty =
DependencyProperty.Register("BindingItems", typeof(ObservableCollection<PUTreeViewItemModel>), typeof(PUTreeView), new PropertyMetadata(OnBindingItemsChanged));
private static void OnBindingItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var treeView = d as PUTreeView;
if (treeView.BindingItems != null)
{
treeView.BindingItems.CollectionChanged -= treeView.BindingItemChanged;
treeView.BindingItems.CollectionChanged += treeView.BindingItemChanged;
}
treeView.GenerateBindindItems(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
private void BindingItemChanged(object sender, NotifyCollectionChangedEventArgs e)
{
GenerateBindindItems(e);
}
#endregion
#region APIs
/// <summary>
/// 通过标题选中子项。
/// 若标题不是值类型,则将逐一比较每一个可写属性的值是否相等。
/// </summary>
/// <param name="header">要匹配的标题。</param>
public void ChooseItemByHeader(object header)
{
var tvi = GetItemByHeader(header, true, false);
if (tvi != null)
{
if (!tvi.IsChoosed && !tvi.HasItems)
tvi.IsChoosed = true;
}
else if (tvi == null)
{
if (ChoosedItem != null)
{
ChoosedItem.IsChoosed = false;
ChoosedItem = null;
}
ChoosedValue = null;
}
}
/// <summary>
/// 通过Value获取子项。
/// 若Value不是值类型,则将逐一比较每一个可写属性的值是否相等。
/// </summary>
/// <param name="value">要匹配的值。</param>
public void ChooseItemByValue(object value)
{
var tvi = GetItemByValue(value, true, false);
if (tvi != null)
{
if (!tvi.IsChoosed && !tvi.HasItems)
tvi.IsChoosed = true;
}
else if (tvi == null)
{
if (ChoosedItem != null)
{
ChoosedItem.IsChoosed = false;
ChoosedItem = null;
}
ChoosedValue = null;
}
}
#endregion
#region Function
/// <summary>
/// 通过标题获取Item。
/// </summary>
/// <param name="header">要匹配的标题。</param>
/// <param name="autoExpand">在检索过程中是否自动折叠不是目标项的项目,并将目标项的父PUTreeViewItem展开。</param>
/// <param name="includeParent">返回结果中是否包含含有子项的项目。</param>
/// <returns></returns>
private PUTreeViewItem GetItemByHeader(object header, bool autoExpand = false, bool includeParent = true)
{
foreach (var item in Items)
{
var tvi = item as PUTreeViewItem;
if (autoExpand)
tvi.IsExpanded = false;
var tvix = GetTreeViewItemByHeader(tvi, header, autoExpand, includeParent);
if (tvix != null)
{
if (autoExpand)
{
var parent = tvix.Parent as PUTreeViewItem;
if (parent != null)
parent.IsExpanded = true;
}
return tvix;
}
}
return null;
}
/// <summary>
/// 通过Value获取Item。
/// </summary>
/// <param name="value">要匹配的Value。</param>
/// <param name="autoExpand">在检索过程中是否自动折叠不是目标项的项目,并将目标项的父PUTreeViewItem展开。</param>
/// <param name="includeParent">返回结果中是否包含含有子项的项目。</param>
/// <returns></returns>
private PUTreeViewItem GetItemByValue(object value, bool autoExpand = false, bool includeParent = true)
{
foreach (var item in Items)
{
var tvi = item as PUTreeViewItem;
if (autoExpand)
tvi.IsExpanded = false;
var tvix = GetTreeViewItemByValue(tvi, value, autoExpand, includeParent);
if (tvix != null)
{
if (autoExpand)
{
var parent = tvix.Parent as PUTreeViewItem;
if (parent != null)
parent.IsExpanded = true;
}
return tvix;
}
}
return null;
}
private PUTreeViewItem GetTreeViewItemByHeader(PUTreeViewItem item, object header, bool autoExpand, bool includeParent)
{
if ((includeParent || !item.HasItems) && item.Header != null && item.Header.IsEqual(header))
return item;
if (item.HasItems)
{
foreach (var tvi in item.Items)
{
if (autoExpand)
(tvi as PUTreeViewItem).IsExpanded = false;
var tvix = GetTreeViewItemByHeader(tvi as PUTreeViewItem, header, autoExpand, includeParent);
if (tvix != null)
{
if (autoExpand)
(tvi as PUTreeViewItem).IsExpanded = true;
return tvix;
}
}
}
return null;
}
private PUTreeViewItem GetTreeViewItemByValue(PUTreeViewItem item, object value, bool autoExpand, bool includeParent)
{
if ((includeParent || !item.
gitextract_d18lroo2/
├── .gitignore
├── LICENSE
├── Panuon.UI/
│ ├── 0_Base/
│ │ ├── DragableThumb.cs
│ │ ├── NotTopMostPopup.cs
│ │ ├── PUResizeContainer.cs
│ │ ├── PUResizeGrid.cs
│ │ ├── PUResizeThumb.cs
│ │ └── PUWindow.cs
│ ├── 2_Button/
│ │ ├── PUButton.cs
│ │ └── PURepeatButton.cs
│ ├── 3_TextBox/
│ │ └── PUTextBox.cs
│ ├── 4_PasswordBox/
│ │ └── PUPasswordBox.cs
│ ├── 5_ComboBox/
│ │ ├── PUComboBox.cs
│ │ └── PUComboBoxItem.cs
│ ├── 6_CheckBox/
│ │ └── PUCheckBox.cs
│ ├── 7_RadioButton/
│ │ └── PURadioButton.cs
│ ├── 8_ProgressBar/
│ │ └── PUProgressBar.cs
│ ├── 9_Special/
│ │ ├── Countdown.cs
│ │ ├── DateTimePicker.cs
│ │ ├── DropDown.cs
│ │ ├── PUCard.cs
│ │ ├── PUImageCuter.xaml
│ │ ├── PUImageCuter.xaml.cs
│ │ ├── PUIndicator.xaml
│ │ ├── PUIndicator.xaml.cs
│ │ ├── PULoading.xaml
│ │ ├── PULoading.xaml.cs
│ │ ├── PUMessageBox.xaml
│ │ ├── PUMessageBox.xaml.cs
│ │ ├── PUSlideShow.xaml
│ │ ├── PUSlideShow.xaml.cs
│ │ └── PUSplitLine.cs
│ ├── A0_TreeView/
│ │ ├── PUTreeView.cs
│ │ └── PUTreeViewItem.cs
│ ├── A1_Slider/
│ │ ├── PUSlider.xaml
│ │ └── PUSlider.xaml.cs
│ ├── A2_TabControl/
│ │ ├── PUTabControl.cs
│ │ └── PUTabItem.cs
│ ├── A3_ListBox/
│ │ ├── PUListBox.cs
│ │ └── PUListBoxItem.cs
│ ├── A4_DatePicker/
│ │ ├── PUDatePicker.xaml
│ │ └── PUDatePicker.xaml.cs
│ ├── A5_PagingNav/
│ │ ├── PUPagingNav.xaml
│ │ └── PUPagingNav.xaml.cs
│ ├── A6_ContextMenu/
│ │ ├── PUContextMenu.cs
│ │ └── PUContextMenuItem.cs
│ ├── A7_Bubble/
│ │ └── PUBubble.cs
│ ├── Helper/
│ │ └── Helper.cs
│ ├── Others/
│ │ └── Enums.cs
│ ├── Panuon.UI.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Themes/
│ │ ├── Control.xaml
│ │ ├── Generic.xaml
│ │ └── Resources.xaml
│ ├── Utils/
│ │ ├── Converters.cs
│ │ ├── Extends.cs
│ │ └── Utils.cs
│ ├── Z_Helper/
│ │ └── Helper.cs
│ ├── Z_Models/
│ │ ├── PUComboBoxItemModel.cs
│ │ ├── PUListBoxItemModel.cs
│ │ ├── PUTabItemModel.cs
│ │ └── PUTreeViewItemModel.cs
│ ├── Z_Others/
│ │ ├── Converters.cs
│ │ ├── Enums.cs
│ │ └── SkipCompareAttribute.cs
│ └── Z_Utils/
│ ├── Extends.cs
│ └── Utils.cs
├── Panuon.UI.Charts/
│ ├── 0_Base/
│ │ ├── PUChartPoint.cs
│ │ ├── PUChartToolTip.xaml
│ │ └── PUChartToolTip.xaml.cs
│ ├── 1_LineChart/
│ │ ├── PULineChart.cs
│ │ ├── PULineChart.xaml
│ │ └── PULineChart.xaml.cs
│ ├── Others/
│ │ └── Enums.cs
│ ├── Panuon.UI.Charts.csproj
│ └── Properties/
│ └── AssemblyInfo.cs
├── Panuon.UI.sln
├── Panuon.UIBrowser/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppBootstrapper.cs
│ ├── IShell.cs
│ ├── Models/
│ │ └── DataSourceModel.cs
│ ├── Panuon.UIBrowser.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── ViewModels/
│ │ ├── Chart/
│ │ │ └── LineChartViewModel.cs
│ │ ├── Control/
│ │ │ ├── ButtonViewModel.cs
│ │ │ ├── CheckBoxViewModel.cs
│ │ │ ├── ComboBoxViewModel.cs
│ │ │ ├── ContextMenuViewModel.cs
│ │ │ ├── DatePickerViewModel.cs
│ │ │ ├── ListBoxViewModel.cs
│ │ │ ├── PasswordBoxViewModel.cs
│ │ │ ├── ProgressBarViewModel.cs
│ │ │ ├── RadioButtonViewModel.cs
│ │ │ ├── SliderViewModel.cs
│ │ │ ├── TabControlViewModel.cs
│ │ │ ├── TextBoxViewModel.cs
│ │ │ ├── TreeViewViewModel.cs
│ │ │ └── WindowViewModel.cs
│ │ ├── Example.cs
│ │ ├── IntroductionViewModel.cs
│ │ ├── MainWindowViewModel.cs
│ │ ├── OverviewViewModel.cs
│ │ ├── Partial/
│ │ │ ├── BubblesViewModel.cs
│ │ │ ├── ButtonsViewModel.cs
│ │ │ ├── CheckBoxsViewModel.cs
│ │ │ ├── ComboBoxsViewModel.cs
│ │ │ ├── ContextMenusViewModel.cs
│ │ │ ├── DataGridsViewModel.cs
│ │ │ ├── DatePickersViewModel.cs
│ │ │ ├── GridsViewModel.cs
│ │ │ ├── ImageCuterViewModel.cs
│ │ │ ├── IntroductionViewModel.cs
│ │ │ ├── LineChartsViewModel.cs
│ │ │ ├── ListBoxsViewModel.cs
│ │ │ ├── PagingNavsViewModel.cs
│ │ │ ├── PasswordBoxsViewModel.cs
│ │ │ ├── ProgressBarsViewModel.cs
│ │ │ ├── RadioButtonsViewModel.cs
│ │ │ ├── SlidersViewModel.cs
│ │ │ ├── SpecialViewModel.cs
│ │ │ ├── TabControlsViewModel.cs
│ │ │ ├── TextBoxsViewModel.cs
│ │ │ ├── TreeViewsViewModel.cs
│ │ │ ├── UtilsViewModel.cs
│ │ │ └── WindowsViewModel.cs
│ │ ├── ShellWindowViewModel.cs
│ │ └── Special/
│ │ ├── BubbleViewModel.cs
│ │ ├── DropDownViewModel.cs
│ │ ├── ImageCuterViewModel.cs
│ │ ├── LoadingViewModel.cs
│ │ ├── PagingNavViewModel.cs
│ │ ├── ResizeGridViewModel.cs
│ │ └── SplitLineViewModel.cs
│ ├── Views/
│ │ ├── Chart/
│ │ │ └── LineChartView.xaml
│ │ ├── Controls/
│ │ │ ├── ButtonView.xaml
│ │ │ ├── CheckBoxView.xaml
│ │ │ ├── ComboBoxView.xaml
│ │ │ ├── ContextMenuView.xaml
│ │ │ ├── DatePickerView.xaml
│ │ │ ├── Examples/
│ │ │ │ ├── ChatWindow.xaml
│ │ │ │ ├── ChatWindow.xaml.cs
│ │ │ │ ├── LoginWindow.xaml
│ │ │ │ ├── LoginWindow.xaml.cs
│ │ │ │ ├── MultiNavWindow.xaml
│ │ │ │ └── MultiNavWindow.xaml.cs
│ │ │ ├── ListBoxView.xaml
│ │ │ ├── PasswordBoxView.xaml
│ │ │ ├── ProgressBarView.xaml
│ │ │ ├── RadioButtonView.xaml
│ │ │ ├── SliderView.xaml
│ │ │ ├── TabControlView.xaml
│ │ │ ├── TextBoxView.xaml
│ │ │ ├── TreeViewView.xaml
│ │ │ └── WindowView.xaml
│ │ ├── MainWindowView.xaml
│ │ ├── OverviewView.xaml
│ │ ├── Partial/
│ │ │ ├── BubblesView.xaml
│ │ │ ├── ButtonsView.xaml
│ │ │ ├── CheckBoxsView.xaml
│ │ │ ├── ComboBoxsView.xaml
│ │ │ ├── ContextMenusView.xaml
│ │ │ ├── DataGridsView.xaml
│ │ │ ├── DatePickersView.xaml
│ │ │ ├── HelpersView.xaml
│ │ │ ├── ImageCuterView.xaml
│ │ │ ├── IntroductionView.xaml
│ │ │ ├── LineChartsView.xaml
│ │ │ ├── ListBoxsView.xaml
│ │ │ ├── PagingNavsView.xaml
│ │ │ ├── PasswordBoxsView.xaml
│ │ │ ├── ProgressBarsView.xaml
│ │ │ ├── RadioButtonsView.xaml
│ │ │ ├── SlidersView.xaml
│ │ │ ├── SpecialView.xaml
│ │ │ ├── TabControlsView.xaml
│ │ │ ├── TextBoxsView.xaml
│ │ │ ├── TreeViewsView.xaml
│ │ │ ├── UtilsView.xaml
│ │ │ └── WindowsView.xaml
│ │ ├── ShellWindowView.xaml
│ │ └── Special/
│ │ ├── BubbleView.xaml
│ │ ├── DropDownView.xaml
│ │ ├── ImageCuterView.xaml
│ │ ├── IndicatorView.xaml
│ │ ├── LoadingView.xaml
│ │ ├── PagingNavView.xaml
│ │ ├── ResizeGridView.xaml
│ │ └── SplitLineView.xaml
│ ├── app.config
│ └── packages.config
├── README.md
└── packages/
├── Caliburn.Micro.3.2.0/
│ ├── Caliburn.Micro.3.2.0.nupkg
│ └── lib/
│ ├── MonoAndroid10/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ ├── MonoTouch10/
│ │ ├── Caliburn.Micro.Platform.Core.dll.mdb
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── Caliburn.Micro.dll.mdb
│ ├── Xamarin.iOS10/
│ │ ├── Caliburn.Micro.Platform.Core.dll.mdb
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── Caliburn.Micro.dll.mdb
│ ├── net40/
│ │ ├── Caliburn.Micro.Platform.xml
│ │ └── System.Windows.Interactivity.xml
│ ├── net45/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ ├── sl5/
│ │ └── Caliburn.Micro.Platform.xml
│ ├── uap10.0/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.UWP/
│ │ │ └── Properties/
│ │ │ └── Caliburn.Micro.Platform.UWP.rd.xml
│ │ ├── Caliburn.Micro.Platform.UWP.XML
│ │ └── Caliburn.Micro.Platform.UWP.pri
│ ├── win81/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ ├── Caliburn.Micro.Platform.XML
│ │ └── Caliburn.Micro.Platform.pri
│ ├── wp8/
│ │ ├── Caliburn.Micro.Platform.Core.xml
│ │ └── Caliburn.Micro.Platform.xml
│ └── wpa81/
│ ├── Caliburn.Micro.Platform.Core.xml
│ ├── Caliburn.Micro.Platform.pri
│ └── Caliburn.Micro.Platform.xml
└── Caliburn.Micro.Core.3.2.0/
├── Caliburn.Micro.Core.3.2.0.nupkg
└── lib/
├── net40/
│ └── Caliburn.Micro.XML
├── net45/
│ └── Caliburn.Micro.xml
├── portable-net45+win8+wp8+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10+uap10.0/
│ ├── Caliburn.Micro.XML
│ └── Caliburn.Micro.dll.mdb
└── sl5/
└── Caliburn.Micro.XML
SYMBOL INDEX (915 symbols across 118 files)
FILE: Panuon.UI.Charts/0_Base/PUChartPoint.cs
class PUChartPoint (line 15) | public class PUChartPoint
FILE: Panuon.UI.Charts/0_Base/PUChartToolTip.xaml.cs
class PUChartToolTip (line 20) | public partial class PUChartToolTip : UserControl
method PUChartToolTip (line 22) | public PUChartToolTip()
method PUChartToolTip (line 26) | public PUChartToolTip(object header, object value)
FILE: Panuon.UI.Charts/1_LineChart/PULineChart.cs
class PULineChart (line 9) | public class PULineChart : UserControl
method PULineChart (line 11) | static PULineChart()
FILE: Panuon.UI.Charts/1_LineChart/PULineChart.xaml.cs
class PULineChart (line 19) | public partial class PULineChart : UserControl
method PULineChart (line 27) | public PULineChart()
method OnApplyTemplate (line 31) | public override void OnApplyTemplate()
method OnXAxisGapChanged (line 54) | private static void OnXAxisGapChanged(DependencyObject d, DependencyPr...
method OnXAxisChanged (line 149) | private static void OnXAxisChanged(DependencyObject d, DependencyPrope...
method XAxisChanged (line 161) | private void XAxisChanged(object sender, NotifyCollectionChangedEventA...
method OnYAxisChanged (line 180) | private static void OnYAxisChanged(DependencyObject d, DependencyPrope...
method YAxisChanged (line 191) | private void YAxisChanged(object sender, NotifyCollectionChangedEventA...
method OnPointsChanged (line 209) | private static void OnPointsChanged(DependencyObject d, DependencyProp...
method PointsChanged (line 221) | private void PointsChanged(object sender, NotifyCollectionChangedEvent...
method Draw (line 235) | private void Draw()
method LoadYAxis (line 248) | private void LoadYAxis(double actualHeight)
method LoadXAxis (line 285) | private void LoadXAxis(double actualWidth)
method GetTextWidth (line 320) | private double GetTextWidth(TextBlock textBlock)
method GetTexHeight (line 335) | private double GetTexHeight(TextBlock textBlock)
method DrawGrid (line 351) | private void DrawGrid(double actualWidth, double actualHeight)
method InitLine (line 376) | private void InitLine(double actualWidth, double actualHeight, bool us...
method GetDoubleAnimation (line 443) | private DoubleAnimation GetDoubleAnimation(double to, double duration ...
method chart_SizeChanged (line 456) | private void chart_SizeChanged(object sender, SizeChangedEventArgs e)
FILE: Panuon.UI.Charts/Others/Enums.cs
type AnimationModes (line 18) | public enum AnimationModes
FILE: Panuon.UI/0_Base/DragableThumb.cs
class DragableThumb (line 11) | internal class DragableThumb : Thumb
method DragableThumb (line 13) | static DragableThumb()
method DragableThumb (line 18) | public DragableThumb()
method ResizeThumb_DragDelta (line 23) | private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
FILE: Panuon.UI/0_Base/NotTopMostPopup.cs
class NotTopMostPopup (line 13) | internal class NotTopMostPopup : Popup
method OnOpened (line 16) | protected override void OnOpened(EventArgs e)
method OnClosed (line 31) | protected override void OnClosed(EventArgs e)
method Window_PreviewMouseDown (line 38) | private void Window_PreviewMouseDown(object sender, MouseButtonEventAr...
type RECT (line 47) | [StructLayout(LayoutKind.Sequential)]
method GetWindowRect (line 56) | [DllImport("user32.dll")]
method SetWindowPos (line 60) | [DllImport("user32", EntryPoint = "SetWindowPos")]
FILE: Panuon.UI/0_Base/PUResizeContainer.cs
class PUResizeContainer (line 6) | internal class PUResizeContainer : ContentControl
method PUResizeContainer (line 8) | static PUResizeContainer()
FILE: Panuon.UI/0_Base/PUResizeGrid.cs
class PUResizeGrid (line 7) | public class PUResizeGrid : UserControl
method PUResizeGrid (line 9) | static PUResizeGrid()
FILE: Panuon.UI/0_Base/PUResizeThumb.cs
class ResizeThumb (line 10) | internal class ResizeThumb : Thumb
method ResizeThumb (line 12) | public ResizeThumb()
method ResizeThumb_DragDelta (line 39) | private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
method SetElementWidth (line 150) | private void SetElementWidth(FrameworkElement element, double width, d...
method SetElementHeight (line 160) | private void SetElementHeight(FrameworkElement element, double height,...
FILE: Panuon.UI/0_Base/PUWindow.cs
class PUWindow (line 16) | public class PUWindow : Window
method GetForegroundWindow (line 19) | [DllImport("user32.dll")]
method SendMessage (line 22) | [DllImport("user32.dll", CharSet = CharSet.Auto)]
type ResizeDirection (line 27) | private enum ResizeDirection
method PUWindow (line 54) | static PUWindow()
method PUWindow (line 63) | public PUWindow()
method OnApplyTemplate (line 70) | public override void OnApplyTemplate()
method OnClosing (line 109) | protected override void OnClosing(CancelEventArgs e)
method ResizeRectangle_PreviewMouseDown (line 169) | private void ResizeRectangle_PreviewMouseDown(object sender, MouseButt...
method ResizeWindow (line 215) | private void ResizeWindow(ResizeDirection direction)
method OnInitialized (line 220) | protected override void OnInitialized(EventArgs e)
method MainWindow_SourceInitialized (line 227) | private void MainWindow_SourceInitialized(object sender, EventArgs e)
method OnPreviewMouseMove (line 232) | protected void OnPreviewMouseMove(object sender, MouseEventArgs e)
method ResizeRectangle_MouseMove (line 241) | private void ResizeRectangle_MouseMove(object sender, MouseEventArgs e)
method DisableAltF4 (line 282) | private static Action DisableAltF4(Window window)
method DisableAltF4WndHookProc (line 292) | private static IntPtr DisableAltF4WndHookProc(IntPtr hwnd, int msg, In...
method OnBeginLoadStoryboard (line 317) | internal void OnBeginLoadStoryboard()
method OnSkipLoadStoryboard (line 332) | internal void OnSkipLoadStoryboard()
method OnBeginCloseStoryboard (line 347) | internal void OnBeginCloseStoryboard()
method OnAllowAutoOwnerChanged (line 567) | private static void OnAllowAutoOwnerChanged(DependencyObject d, Depend...
method AppendNavButton (line 626) | public void AppendNavButton(object content, RoutedEventHandler clickHa...
method IsModal (line 664) | private static bool IsModal(Window window)
method GetWindowFromHwnd (line 669) | private static PUWindow GetWindowFromHwnd(IntPtr hwnd)
method GetOwnerWindow (line 674) | private static PUWindow GetOwnerWindow()
class CloseWindowCommand (line 686) | internal class CloseWindowCommand : ICommand
method CanExecute (line 694) | public bool CanExecute(object parameter)
method Execute (line 699) | public void Execute(object parameter)
class MaxWindowCommand (line 705) | internal class MaxWindowCommand : ICommand
method CanExecute (line 713) | public bool CanExecute(object parameter)
method Execute (line 718) | public void Execute(object parameter)
class MinWindowCommand (line 727) | internal class MinWindowCommand : ICommand
method CanExecute (line 735) | public bool CanExecute(object parameter)
method Execute (line 740) | public void Execute(object parameter)
FILE: Panuon.UI/2_Button/PUButton.cs
class PUButton (line 7) | public class PUButton : Button
method PUButton (line 9) | static PUButton()
FILE: Panuon.UI/2_Button/PURepeatButton.cs
class PURepeatButton (line 7) | public class PURepeatButton : RepeatButton
method PURepeatButton (line 9) | static PURepeatButton()
FILE: Panuon.UI/3_TextBox/PUTextBox.cs
class PUTextBox (line 8) | public class PUTextBox : TextBox
method PUTextBox (line 10) | static PUTextBox()
method OnApplyTemplate (line 16) | public override void OnApplyTemplate()
method PUTextBox_PreviewKeyDown (line 36) | private void PUTextBox_PreviewKeyDown(object sender, System.Windows.In...
method OnClearButtonClick (line 86) | private void OnClearButtonClick(object sender, RoutedEventArgs e)
method ScrollViewer_MouseWheel (line 94) | private void ScrollViewer_MouseWheel(object sender, System.Windows.Inp...
method OnTextTypeChanged (line 212) | private static void OnTextTypeChanged(DependencyObject d, DependencyPr...
FILE: Panuon.UI/4_PasswordBox/PUPasswordBox.cs
class PUPasswordBox (line 11) | [ContentProperty(nameof(Password))]
method PUPasswordBox (line 19) | static PUPasswordBox()
method OnApplyTemplate (line 24) | public override void OnApplyTemplate()
method BtnShowPwd_MouseLeftButtonUp (line 49) | private void BtnShowPwd_MouseLeftButtonUp(object sender, MouseButtonEv...
method BtnShowPwd_MouseLeftButtonDown (line 56) | private void BtnShowPwd_MouseLeftButtonDown(object sender, MouseButton...
method PUPasswordBox_TextInput (line 62) | private void PUPasswordBox_TextInput(object sender, TextCompositionEve...
method PUPasswordBox_PreviewKeyDown (line 87) | private void PUPasswordBox_PreviewKeyDown(object sender, KeyEventArgs e)
method OnPasswordChanged (line 176) | private static void OnPasswordChanged(DependencyObject d, DependencyPr...
FILE: Panuon.UI/5_ComboBox/PUComboBox.cs
class PUComboBox (line 14) | public class PUComboBox : ComboBox
method PUComboBox (line 17) | static PUComboBox()
method OnApplyTemplate (line 22) | public override void OnApplyTemplate()
method OnSelectionChanged (line 42) | protected override void OnSelectionChanged(SelectionChangedEventArgs e)
method OnSearchKeyDown (line 51) | private void OnSearchKeyDown(object sender, RoutedEventArgs e)
method OnSearchTextChanged (line 71) | private void OnSearchTextChanged(object sender, RoutedEventArgs e)
method OnDeleteItem (line 98) | internal void OnDeleteItem(PUComboBoxItem oldItem, PUComboBoxItem newI...
method OnBindingItemsChanged (line 191) | private static void OnBindingItemsChanged(DependencyObject d, Dependen...
method BindingItemChanged (line 202) | private void BindingItemChanged(object sender, NotifyCollectionChanged...
method OnSelectedValueChanged (line 233) | private static void OnSelectedValueChanged(DependencyObject d, Depende...
method OnSearchModeChanged (line 271) | private static void OnSearchModeChanged(DependencyObject d, Dependency...
method SelectItemByContent (line 315) | public void SelectItemByContent(object content)
method SelectItemByValue (line 327) | public void SelectItemByValue(object value)
method GenerateBindindItems (line 338) | private void GenerateBindindItems(NotifyCollectionChangedEventArgs e)
method GenerateComboBoxItem (line 392) | private PUComboBoxItem GenerateComboBoxItem(PUComboBoxItemModel model)
method GetItemByContent (line 412) | private PUComboBoxItem GetItemByContent(object content)
method GetItemByValue (line 425) | private PUComboBoxItem GetItemByValue(object value)
FILE: Panuon.UI/5_ComboBox/PUComboBoxItem.cs
class PUComboBoxItem (line 9) | public class PUComboBoxItem : ComboBoxItem
method PUComboBoxItem (line 12) | public PUComboBoxItem()
method PUComboBoxItem (line 17) | static PUComboBoxItem()
class PUComboBoxDeleteCommand (line 58) | internal sealed class PUComboBoxDeleteCommand : ICommand
method CanExecute (line 66) | public bool CanExecute(object parameter)
method Execute (line 71) | public void Execute(object parameter)
FILE: Panuon.UI/6_CheckBox/PUCheckBox.cs
class PUCheckBox (line 7) | public class PUCheckBox : CheckBox
method PUCheckBox (line 9) | static PUCheckBox()
FILE: Panuon.UI/7_RadioButton/PURadioButton.cs
class PURadioButton (line 7) | public class PURadioButton : RadioButton
method PURadioButton (line 9) | static PURadioButton()
FILE: Panuon.UI/8_ProgressBar/PUProgressBar.cs
class PUProgressBar (line 9) | public class PUProgressBar : Control
method PUProgressBar (line 11) | static PUProgressBar()
method OnApplyTemplate (line 16) | public override void OnApplyTemplate()
method OnPercentChanged (line 36) | internal void OnPercentChanged(double oldValue, double newValue)
method OnPercentChanged (line 129) | private static void OnPercentChanged(DependencyObject d, DependencyPro...
method OnBorderThicknessChanged (line 159) | private static void OnBorderThicknessChanged(DependencyObject d, Depen...
method Change (line 213) | private void Change()
FILE: Panuon.UI/9_Special/Countdown.cs
class Countdown (line 8) | public class Countdown : Control
method Countdown (line 14) | static Countdown()
method Countdown (line 19) | public Countdown()
method RaiseTimeChanged (line 34) | void RaiseTimeChanged(int oldValue, int newValue)
method RaiseStoped (line 46) | void RaiseStoped()
method OnSecondChanged (line 73) | private static void OnSecondChanged(DependencyObject d, DependencyProp...
method OnIsRunningChanged (line 93) | private static void OnIsRunningChanged(DependencyObject d, DependencyP...
method CountdownTimer_Tick (line 110) | private void CountdownTimer_Tick(object sender, EventArgs e)
FILE: Panuon.UI/9_Special/DateTimePicker.cs
class PUDateTimeSelector (line 11) | public class PUDateTimeSelector : Control
method PUDateTimeSelector (line 14) | static PUDateTimeSelector()
method PUDateTimeSelector (line 19) | public PUDateTimeSelector()
method OnSelectedDateTimeChanged (line 76) | private static void OnSelectedDateTimeChanged(DependencyObject d, Depe...
method UpdateText (line 121) | private void UpdateText()
FILE: Panuon.UI/9_Special/DropDown.cs
class DropDown (line 11) | public class DropDown : ContentControl
method DropDown (line 13) | static DropDown()
FILE: Panuon.UI/9_Special/PUCard.cs
class PUCard (line 8) | public class PUCard : UserControl
method PUCard (line 11) | static PUCard()
method OnApplyTemplate (line 17) | public override void OnApplyTemplate()
method OnDetailButtonClicked (line 23) | private void OnDetailButtonClicked(object sender, RoutedEventArgs e)
method OnDetail (line 42) | internal void OnDetail()
FILE: Panuon.UI/9_Special/PUImageCuter.xaml.cs
class PUImageCuter (line 20) | public partial class PUImageCuter : UserControl
method PUImageCuter (line 22) | public PUImageCuter()
method OnImageTypeChanged (line 46) | private static void OnImageTypeChanged(DependencyObject d, DependencyP...
method Img_SizeChanged (line 92) | private void Img_SizeChanged(object sender, SizeChangedEventArgs e)
method GetCutedImage (line 103) | public BitmapSource GetCutedImage()
FILE: Panuon.UI/9_Special/PUIndicator.xaml.cs
class PUIndicator (line 13) | public partial class PUIndicator : UserControl
method PUIndicator (line 15) | public PUIndicator()
method OnIndexChanged (line 49) | internal void OnIndexChanged(int oldValue, int newValue)
method OnDircetionDircetionChanged (line 72) | private static void OnDircetionDircetionChanged(DependencyObject d, De...
method OnIndexChanged (line 115) | private static void OnIndexChanged(DependencyObject d, DependencyPrope...
method Draw (line 140) | private void Draw()
method ChangeIndex (line 223) | private void ChangeIndex(bool usingAnima)
method UserControl_SizeChanged (line 265) | private void UserControl_SizeChanged(object sender, SizeChangedEventAr...
FILE: Panuon.UI/9_Special/PULoading.xaml.cs
class PULoading (line 13) | public partial class PULoading : UserControl
method PULoading (line 17) | public PULoading()
method PULoading_Loaded (line 23) | private void PULoading_Loaded(object sender, RoutedEventArgs e)
method OnApplyTemplate (line 29) | public override void OnApplyTemplate()
method OnIsRunningChanged (line 42) | private static void OnIsRunningChanged(DependencyObject d, DependencyP...
method Draw (line 57) | internal void Draw()
method Clear (line 121) | internal void Clear()
method GetDoubleAnimation (line 130) | private DoubleAnimation GetDoubleAnimation(double to, double beginTime...
method GetDoubleAnimationUsingPath (line 141) | private DoubleAnimationUsingPath GetDoubleAnimationUsingPath(string pa...
FILE: Panuon.UI/9_Special/PUMessageBox.xaml.cs
class PUMessageBox (line 13) | public partial class PUMessageBox : UI.PUWindow
method PUMessageBox (line 21) | private PUMessageBox(string title, string content, bool isConfirm, boo...
method ShowDialog (line 46) | public static void ShowDialog(string content, string title = "提示", But...
method ShowConfirm (line 62) | public static bool? ShowConfirm(string content, string title = "提示", B...
method ShowAwait (line 77) | public static void ShowAwait(string content)
method ShowAwait (line 96) | public static void ShowAwait(string content, RoutedEventHandler cancel...
method ShowAwait (line 116) | public static void ShowAwait(string content, string title = "提示", Rout...
method CloseAwait (line 134) | public static void CloseAwait()
method CloseAwait (line 151) | public static void CloseAwait(EventHandler closedCallback)
method CheckButtonContent (line 168) | private void CheckButtonContent(Buttons buttons)
method PUButton_Click (line 208) | private void PUButton_Click(object sender, RoutedEventArgs e)
method PUButtonYes_Click (line 223) | private void PUButtonYes_Click(object sender, RoutedEventArgs e)
method PUButtonNo_Click (line 228) | private void PUButtonNo_Click(object sender, RoutedEventArgs e)
FILE: Panuon.UI/9_Special/PUSlideShow.xaml.cs
class PUSlideShow (line 13) | [ContentProperty(nameof(Content))]
method PUSlideShow (line 20) | public PUSlideShow()
method OnContentChanged (line 53) | private static void OnContentChanged(DependencyObject d, DependencyPro...
method OnIndexChanged (line 76) | private static void OnIndexChanged(DependencyObject d, DependencyPrope...
method OnSlideDirectionChanged (line 97) | private static void OnSlideDirectionChanged(DependencyObject d, Depend...
method OnIsSlideButtonShowChanged (line 149) | private static void OnIsSlideButtonShowChanged(DependencyObject d, Dep...
method OnSlideButtonBrushChanged (line 176) | private static void OnSlideButtonBrushChanged(DependencyObject d, Depe...
method OnAnimationDurationChanged (line 202) | private static void OnAnimationDurationChanged(DependencyObject d, Dep...
method OnIsIndicatorShowChanged (line 235) | private static void OnIsIndicatorShowChanged(DependencyObject d, Depen...
method OnIndicatorBrushChanged (line 257) | private static void OnIndicatorBrushChanged(DependencyObject d, Depend...
method Draw (line 266) | private void Draw()
method ChangeIndex (line 277) | private void ChangeIndex()
method BtnLeft_Click (line 352) | private void BtnLeft_Click(object sender, RoutedEventArgs e)
method BtnRight_Click (line 357) | private void BtnRight_Click(object sender, RoutedEventArgs e)
method UserControl_SizeChanged (line 362) | private void UserControl_SizeChanged(object sender, SizeChangedEventAr...
FILE: Panuon.UI/9_Special/PUSplitLine.cs
class PUSplitLine (line 6) | public class PUSplitLine : Control
method PUSplitLine (line 8) | static PUSplitLine()
type Alignments (line 30) | public enum Alignments
FILE: Panuon.UI/A0_TreeView/PUTreeView.cs
class PUTreeView (line 14) | public class PUTreeView : TreeView
method PUTreeView (line 16) | static PUTreeView()
method OnApplyTemplate (line 21) | public override void OnApplyTemplate()
method OnChoosedItemChanged (line 36) | internal void OnChoosedItemChanged(PUTreeViewItem oldItem, PUTreeViewI...
method OnChoosedItemChanged (line 132) | private static void OnChoosedItemChanged(DependencyObject d, Dependenc...
method OnChoosedValueChanged (line 190) | private static void OnChoosedValueChanged(DependencyObject d, Dependen...
method OnBindingItemsChanged (line 231) | private static void OnBindingItemsChanged(DependencyObject d, Dependen...
method BindingItemChanged (line 242) | private void BindingItemChanged(object sender, NotifyCollectionChanged...
method ChooseItemByHeader (line 254) | public void ChooseItemByHeader(object header)
method ChooseItemByValue (line 278) | public void ChooseItemByValue(object value)
method GetItemByHeader (line 307) | private PUTreeViewItem GetItemByHeader(object header, bool autoExpand ...
method GetItemByValue (line 337) | private PUTreeViewItem GetItemByValue(object value, bool autoExpand = ...
method GetTreeViewItemByHeader (line 360) | private PUTreeViewItem GetTreeViewItemByHeader(PUTreeViewItem item, ob...
method GetTreeViewItemByValue (line 382) | private PUTreeViewItem GetTreeViewItemByValue(PUTreeViewItem item, obj...
method GenerateBindindItems (line 404) | private void GenerateBindindItems(NotifyCollectionChangedEventArgs e)
method GenerateTreeViewItem (line 458) | private PUTreeViewItem GenerateTreeViewItem(PUTreeViewItemModel model)
method Generate (line 492) | private IEnumerable<PUTreeViewItem> Generate(IList<PUTreeViewItemModel...
FILE: Panuon.UI/A0_TreeView/PUTreeViewItem.cs
class PUTreeViewItem (line 9) | public class PUTreeViewItem : TreeViewItem
method PUTreeViewItem (line 31) | static PUTreeViewItem()
method OnApplyTemplate (line 36) | public override void OnApplyTemplate()
method OnIsChoosedChanged (line 70) | private static void OnIsChoosedChanged(DependencyObject d, DependencyP...
method Stk_MouseLeftButtonDown (line 96) | private void Stk_MouseLeftButtonDown(object sender, RoutedEventArgs e)
FILE: Panuon.UI/A1_Slider/PUSlider.xaml.cs
class PUSlider (line 11) | public partial class PUSlider : UserControl
method PUSlider (line 15) | public PUSlider()
method Thumb_DragDelta (line 25) | private void Thumb_DragDelta(object sender, System.Windows.Controls.Pr...
method OnValueChanged (line 75) | internal void OnValueChanged(int oldValue, int newValue)
method OnValuesChanged (line 131) | private static void OnValuesChanged(DependencyObject d, DependencyProp...
method RecheckSlideBar (line 143) | private bool RecheckSlideBar()
method slider_SizeChanged (line 164) | private void slider_SizeChanged(object sender, SizeChangedEventArgs e)
FILE: Panuon.UI/A2_TabControl/PUTabControl.cs
class PUTabControl (line 16) | public class PUTabControl : TabControl
method PUTabControl (line 35) | static PUTabControl()
method OnApplyTemplate (line 40) | public override void OnApplyTemplate()
method OnSelectionChanged (line 51) | protected override void OnSelectionChanged(SelectionChangedEventArgs e)
method ScrollViewer_MouseWheel (line 60) | private void ScrollViewer_MouseWheel(object sender, MouseWheelEventArg...
method OnDeleteItem (line 95) | internal void OnDeleteItem(PUTabItem oldItem, PUTabItem newItem)
method OnSelectedValueChanged (line 183) | private static void OnSelectedValueChanged(DependencyObject d, Depende...
method OnBindingItemsChanged (line 223) | private static void OnBindingItemsChanged(DependencyObject d, Dependen...
method BindingItemChanged (line 234) | private void BindingItemChanged(object sender, NotifyCollectionChanged...
method SelectItemByContent (line 300) | public void SelectItemByContent(object content)
method SelectItemByValue (line 307) | public void SelectItemByValue(object value)
method CheckSideButton (line 316) | private void CheckSideButton()
method GenerateBindindItems (line 344) | private void GenerateBindindItems(NotifyCollectionChangedEventArgs e)
method GenerateTabItem (line 398) | private PUTabItem GenerateTabItem(PUTabItemModel model)
method GetItemByContent (line 427) | private PUTabItem GetItemByContent(object content)
method GetItemByValue (line 440) | private PUTabItem GetItemByValue(object value)
class PUTabControlLeftCommand (line 455) | internal sealed class PUTabControlLeftCommand : ICommand
method CanExecute (line 463) | public bool CanExecute(object parameter)
method Execute (line 468) | public void Execute(object parameter)
class PUTabControlRightCommand (line 480) | internal sealed class PUTabControlRightCommand : ICommand
method CanExecute (line 488) | public bool CanExecute(object parameter)
method Execute (line 493) | public void Execute(object parameter)
class PUTabControlUpCommand (line 504) | internal sealed class PUTabControlUpCommand : ICommand
method CanExecute (line 512) | public bool CanExecute(object parameter)
method Execute (line 517) | public void Execute(object parameter)
class PUTabControlDownCommand (line 529) | internal sealed class PUTabControlDownCommand : ICommand
method CanExecute (line 537) | public bool CanExecute(object parameter)
method Execute (line 542) | public void Execute(object parameter)
FILE: Panuon.UI/A2_TabControl/PUTabItem.cs
class PUTabItem (line 9) | public class PUTabItem : TabItem
method PUTabItem (line 11) | static PUTabItem()
class PUTabItemDeleteCommand (line 62) | internal sealed class PUTabItemDeleteCommand : ICommand
method CanExecute (line 70) | public bool CanExecute(object parameter)
method Execute (line 75) | public void Execute(object parameter)
FILE: Panuon.UI/A3_ListBox/PUListBox.cs
class PUListBox (line 12) | public class PUListBox : ListBox
method PUListBox (line 14) | static PUListBox()
method OnSelectionChanged (line 19) | protected override void OnSelectionChanged(SelectionChangedEventArgs e)
method OnSelectedValueChanged (line 65) | private static void OnSelectedValueChanged(DependencyObject d, Depende...
method OnBindingItemsChanged (line 141) | private static void OnBindingItemsChanged(DependencyObject d, Dependen...
method BindingItemChanged (line 152) | private void BindingItemChanged(object sender, NotifyCollectionChanged...
method SelectItemByContent (line 166) | public void SelectItemByContent(object content)
method SelectItemByValue (line 178) | public void SelectItemByValue(object value)
method SearchItemByContent (line 190) | public void SearchItemByContent(string content, bool allowFuzzySearch ...
method SearchItemByValue (line 207) | public void SearchItemByValue(object value)
method GetItemByValue (line 221) | private PUListBoxItem GetItemByValue(object value)
method GetItemByContent (line 235) | private PUListBoxItem GetItemByContent(object content)
method GenerateBindindItems (line 246) | private void GenerateBindindItems(NotifyCollectionChangedEventArgs e)
method GenerateComboBoxItem (line 300) | private PUListBoxItem GenerateComboBoxItem(PUListBoxItemModel model)
FILE: Panuon.UI/A3_ListBox/PUListBoxItem.cs
class PUListBoxItem (line 7) | public class PUListBoxItem : ListBoxItem
method PUListBoxItem (line 9) | static PUListBoxItem()
method OnSearched (line 24) | internal void OnSearched()
FILE: Panuon.UI/A4_DatePicker/PUDatePicker.xaml.cs
class PUDatePicker (line 12) | public partial class PUDatePicker : UserControl
method PUDatePicker (line 15) | public PUDatePicker()
method OnApplyTemplate (line 20) | public override void OnApplyTemplate()
method OnMaxDateTimeChanged (line 54) | private static void OnMaxDateTimeChanged(DependencyObject d, Dependenc...
method OnMinDateTimeChanged (line 75) | private static void OnMinDateTimeChanged(DependencyObject d, Dependenc...
method OnSelectedDateTimeChanged (line 97) | private static void OnSelectedDateTimeChanged(DependencyObject d, Depe...
method OnDatePickerModeChanged (line 151) | private static void OnDatePickerModeChanged(DependencyObject d, Depend...
method ReLoad (line 162) | private void ReLoad()
method LoadDatePanel (line 207) | private void LoadDatePanel()
method ClearDatePanel (line 235) | private void ClearDatePanel()
method LoadTimePanel (line 243) | private void LoadTimePanel()
method ClearTimePanel (line 311) | private void ClearTimePanel()
method LoadYearPanel (line 321) | private void LoadYearPanel()
method ClearYearPanel (line 349) | private void ClearYearPanel()
method LoadMonthPanel (line 357) | private void LoadMonthPanel()
method ClearMonthPanel (line 385) | private void ClearMonthPanel()
method ResetDate (line 393) | private void ResetDate(int year, int month)
method SelectDate (line 542) | private void SelectDate(int year, int month, int day)
method SelectTime (line 563) | private void SelectTime(int hour, int minute, int second)
method ResetAndSelectYear (line 584) | private void ResetAndSelectYear(int year)
method ResetAndSelectMonth (line 636) | private void ResetAndSelectMonth(int month)
method CheckDateTimeLimit (line 685) | private void CheckDateTimeLimit()
method DateRadioButton_Click (line 787) | private void DateRadioButton_Click(object sender, RoutedEventArgs e)
method HourRadioButton_Click (line 807) | private void HourRadioButton_Click(object sender, RoutedEventArgs e)
method MinuteRadioButton_Click (line 816) | private void MinuteRadioButton_Click(object sender, RoutedEventArgs e)
method SecondRadioButton_Click (line 825) | private void SecondRadioButton_Click(object sender, RoutedEventArgs e)
method YearRadioButton_Click (line 834) | private void YearRadioButton_Click(object sender, RoutedEventArgs e)
method MonthRadioButton_Click (line 845) | private void MonthRadioButton_Click(object sender, RoutedEventArgs e)
method BtnDecYear_Click (line 856) | private void BtnDecYear_Click(object sender, RoutedEventArgs e)
method BtnDecMonth_Click (line 864) | private void BtnDecMonth_Click(object sender, RoutedEventArgs e)
method BtnAddMonth_Click (line 872) | private void BtnAddMonth_Click(object sender, RoutedEventArgs e)
method BtnAddYear_Click (line 880) | private void BtnAddYear_Click(object sender, RoutedEventArgs e)
method BtnYearLeft_Click (line 888) | private void BtnYearLeft_Click(object sender, RoutedEventArgs e)
method BtnYearRight_Click (line 896) | private void BtnYearRight_Click(object sender, RoutedEventArgs e)
method BtnMonthLeft_Click (line 904) | private void BtnMonthLeft_Click(object sender, RoutedEventArgs e)
method BtnMonthRight_Click (line 912) | private void BtnMonthRight_Click(object sender, RoutedEventArgs e)
method BtnBackToDate_Click (line 921) | private void BtnBackToDate_Click(object sender, RoutedEventArgs e)
method BtnYear_Click (line 931) | private void BtnYear_Click(object sender, RoutedEventArgs e)
method BtnMonth_Click (line 938) | private void BtnMonth_Click(object sender, RoutedEventArgs e)
method BtnMonthInterval_Click (line 945) | private void BtnMonthInterval_Click(object sender, RoutedEventArgs e)
FILE: Panuon.UI/A5_PagingNav/PUPagingNav.xaml.cs
class PUPagingNav (line 11) | public partial class PUPagingNav : UserControl
method PUPagingNav (line 13) | public PUPagingNav()
method OnApplyTemplate (line 19) | public override void OnApplyTemplate()
method OnCurrentPageChanged (line 39) | internal void OnCurrentPageChanged(int oldItem, int newItem)
method OnTotalPageChanged (line 59) | private static void OnTotalPageChanged(DependencyObject d, DependencyP...
method OnCurrentPageChanged (line 82) | private static void OnCurrentPageChanged(DependencyObject d, Dependenc...
method OnIsSideButtonShowChanged (line 121) | private static void OnIsSideButtonShowChanged(DependencyObject d, Depe...
method Load (line 162) | private void Load()
method Select (line 229) | private void Select()
method GetRadioButton (line 244) | private PURadioButton GetRadioButton(int content)
method GetTextBlock (line 273) | private TextBlock GetTextBlock()
method BtnLeft_Click (line 289) | private void BtnLeft_Click(object sender, RoutedEventArgs e)
method BtnRight_Click (line 295) | private void BtnRight_Click(object sender, RoutedEventArgs e)
FILE: Panuon.UI/A6_ContextMenu/PUContextMenu.cs
class PUContextMenu (line 10) | public class PUContextMenu : ContextMenu
method PUContextMenu (line 12) | static PUContextMenu()
FILE: Panuon.UI/A6_ContextMenu/PUContextMenuItem.cs
class PUContextMenuItem (line 6) | public class PUContextMenuItem : MenuItem
method PUContextMenuItem (line 8) | static PUContextMenuItem()
FILE: Panuon.UI/A7_Bubble/PUBubble.cs
class PUBubble (line 7) | public class PUBubble : UserControl
method PUBubble (line 9) | static PUBubble()
FILE: Panuon.UI/Helper/Helper.cs
class Helper (line 7) | public class Helper : DependencyObject
method GetColumnDefinition (line 10) | public static double GetColumnDefinition(DependencyObject obj)
method SetColumnDefinition (line 15) | public static void SetColumnDefinition(DependencyObject obj, double va...
method OnColumnDefinitionChanged (line 23) | private static void OnColumnDefinitionChanged(DependencyObject d, Depe...
method GetRowDefinition (line 37) | public static double GetRowDefinition(DependencyObject obj)
method SetRowDefinition (line 42) | public static void SetRowDefinition(DependencyObject obj, double value)
method OnRowDefinitionChanged (line 50) | private static void OnRowDefinitionChanged(DependencyObject d, Depende...
method GetHeight (line 67) | public static double GetHeight(DependencyObject obj)
method SetHeight (line 72) | public static void SetHeight(DependencyObject obj, double value)
method OnHeightChanged (line 80) | private static void OnHeightChanged(DependencyObject d, DependencyProp...
method GetWidth (line 97) | public static double GetWidth(DependencyObject obj)
method SetWidth (line 102) | public static void SetWidth(DependencyObject obj, double value)
method OnWidthChanged (line 110) | private static void OnWidthChanged(DependencyObject d, DependencyPrope...
FILE: Panuon.UI/Others/Enums.cs
type ButtonStyles (line 18) | public enum ButtonStyles
type RepeatButtonStyles (line 41) | public enum RepeatButtonStyles
type ClickStyles (line 64) | public enum ClickStyles
type TextBoxStyles (line 76) | public enum TextBoxStyles
type PasswordBoxStyles (line 88) | public enum PasswordBoxStyles
type SelectedValuePaths (line 100) | public enum SelectedValuePaths
type DeleteModes (line 106) | public enum DeleteModes
type SearchModes (line 118) | public enum SearchModes
type CheckBoxStyles (line 134) | public enum CheckBoxStyles
type RadioButtonStyles (line 158) | public enum RadioButtonStyles
type ProgressDirections (line 182) | public enum ProgressDirections
type ProgressBarStyles (line 190) | public enum ProgressBarStyles
type TreeViewStyles (line 202) | public enum TreeViewStyles
type TabControlStyles (line 208) | public enum TabControlStyles
type DatePickerModes (line 214) | public enum DatePickerModes
type AnglePositions (line 230) | public enum AnglePositions
FILE: Panuon.UI/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: Panuon.UI/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: Panuon.UI/Utils/Converters.cs
class GeneralProgressBarConverter (line 10) | internal class GeneralProgressBarConverter : IMultiValueConverter
method Convert (line 12) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 27) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class RingProgressBarConverter (line 33) | internal class RingProgressBarConverter : IMultiValueConverter
method Convert (line 35) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 71) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class BubbleConverter (line 77) | internal class BubbleConverter : IMultiValueConverter
method Convert (line 79) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 149) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class WidthToMarginConverter (line 155) | internal class WidthToMarginConverter : IValueConverter
method Convert (line 157) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 163) | public object ConvertBack(object value, Type targetType, object parame...
class MarginToWidthConverter (line 169) | internal class MarginToWidthConverter : IValueConverter
method Convert (line 171) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 177) | public object ConvertBack(object value, Type targetType, object parame...
class HeaderConverter (line 185) | internal class HeaderConverter : IMultiValueConverter
method Convert (line 187) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 193) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class IconFontSizeConverter (line 199) | internal class IconFontSizeConverter : IValueConverter
method Convert (line 201) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 206) | public object ConvertBack(object value, Type targetType, object parame...
class ScaleConverter (line 213) | internal class ScaleConverter : IMultiValueConverter
method Convert (line 215) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 222) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class ToggleHeightConverter (line 228) | internal class ToggleHeightConverter : IValueConverter
method Convert (line 230) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 235) | public object ConvertBack(object value, Type targetType, object parame...
class ToHalfConverter (line 242) | internal class ToHalfConverter : IValueConverter
method Convert (line 244) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 249) | public object ConvertBack(object value, Type targetType, object parame...
class ToggleTranslateXConverter (line 256) | internal class ToggleTranslateXConverter : IMultiValueConverter
method Convert (line 258) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 264) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class TextBoxInnerWidthConverter (line 271) | internal class TextBoxInnerWidthConverter : IMultiValueConverter
method Convert (line 273) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 282) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class TextBoxInnerHeightConverter (line 289) | internal class TextBoxInnerHeightConverter : IMultiValueConverter
method Convert (line 291) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 300) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
FILE: Panuon.UI/Utils/Extends.cs
class Extends (line 7) | public static class Extends
method ToInt (line 13) | public static int ToInt(this string context)
method ToDouble (line 25) | public static double ToDouble(this string context)
method ToTimeStamp (line 39) | public static long ToTimeStamp(this DateTime date)
method CompareYearMonthDay (line 48) | public static bool CompareYearMonthDay(this DateTime date1, DateTime d...
method ToDate (line 59) | public static DateTime ToDate(this long timeStamp)
method ToString (line 70) | public static string ToString<T>(this IList<T> list,string spliter)
method ToObservableCollection (line 75) | public static ObservableCollection<T> ToObservableCollection<T>(this I...
FILE: Panuon.UI/Utils/Utils.cs
class TaskPoll (line 13) | public class TaskPoll
method Init (line 55) | public static void Init()
method Init (line 65) | public static void Init(int maxTaskQuantity)
method StartNew (line 75) | public static void StartNew(Task task)
method StartNew (line 87) | public static void StartNew<T>(Task<T> task)
method RecheckQueue (line 99) | private static void RecheckQueue()
class PUCache (line 133) | public class PUCache<T>
method PUCache (line 152) | static PUCache()
method Add (line 174) | public static void Add(string uid, T obj)
method Find (line 184) | public static T Find(string uid)
method FindAny (line 198) | public static IList<KeyValuePair<string, T>> FindAny(params string[] u...
method Clear (line 212) | public static void Clear()
method Remove (line 221) | public static bool Remove(string uid)
method Exists (line 231) | public static bool Exists(string uid)
method Exists (line 239) | public static IList<string> Exists(params string[] uids)
FILE: Panuon.UI/Z_Helper/Helper.cs
class Helper (line 7) | public class Helper : DependencyObject
method GetColumnDefinition (line 10) | public static string GetColumnDefinition(DependencyObject obj)
method SetColumnDefinition (line 15) | public static void SetColumnDefinition(DependencyObject obj, string va...
method OnColumnDefinitionChanged (line 23) | private static void OnColumnDefinitionChanged(DependencyObject d, Depe...
method GetRowDefinition (line 53) | public static string GetRowDefinition(DependencyObject obj)
method SetRowDefinition (line 58) | public static void SetRowDefinition(DependencyObject obj, string value)
method OnRowDefinitionChanged (line 66) | private static void OnRowDefinitionChanged(DependencyObject d, Depende...
method GetHeight (line 98) | public static double GetHeight(DependencyObject obj)
method SetHeight (line 103) | public static void SetHeight(DependencyObject obj, double value)
method OnHeightChanged (line 111) | private static void OnHeightChanged(DependencyObject d, DependencyProp...
method GetWidth (line 128) | public static double GetWidth(DependencyObject obj)
method SetWidth (line 133) | public static void SetWidth(DependencyObject obj, double value)
method OnWidthChanged (line 141) | private static void OnWidthChanged(DependencyObject d, DependencyPrope...
FILE: Panuon.UI/Z_Models/PUComboBoxItemModel.cs
class PUComboBoxItemModel (line 6) | public class PUComboBoxItemModel : INotifyPropertyChanged
method OnPropertyChanged (line 8) | protected internal virtual void OnPropertyChanged(string propertyName)
method PUComboBoxItemModel (line 15) | public PUComboBoxItemModel()
FILE: Panuon.UI/Z_Models/PUListBoxItemModel.cs
class PUListBoxItemModel (line 12) | public class PUListBoxItemModel : INotifyPropertyChanged
method OnPropertyChanged (line 14) | protected internal virtual void OnPropertyChanged(string propertyName)
method PUListBoxItemModel (line 22) | public PUListBoxItemModel()
FILE: Panuon.UI/Z_Models/PUTabItemModel.cs
class PUTabItemModel (line 6) | public class PUTabItemModel : INotifyPropertyChanged
method OnPropertyChanged (line 8) | protected internal virtual void OnPropertyChanged(string propertyName)
method PUTabItemModel (line 16) | public PUTabItemModel()
FILE: Panuon.UI/Z_Models/PUTreeViewItemModel.cs
class PUTreeViewItemModel (line 12) | public class PUTreeViewItemModel : INotifyPropertyChanged
method OnPropertyChanged (line 14) | protected internal virtual void OnPropertyChanged(string propertyName)
method PUTreeViewItemModel (line 22) | public PUTreeViewItemModel()
FILE: Panuon.UI/Z_Others/Converters.cs
class DropDownBorderPathConverter (line 9) | internal class DropDownBorderPathConverter : IMultiValueConverter
method Convert (line 11) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 34) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class GeneralProgressBarConverter (line 41) | internal class GeneralProgressBarConverter : IMultiValueConverter
method Convert (line 43) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 58) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class RingProgressBarConverter (line 64) | internal class RingProgressBarConverter : IMultiValueConverter
method Convert (line 66) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 102) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class BubbleConverter (line 108) | internal class BubbleConverter : IMultiValueConverter
method Convert (line 110) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 180) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class IsNullConverter (line 186) | internal class IsNullConverter : IValueConverter
method Convert (line 188) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 193) | public object ConvertBack(object value, Type targetType, object parame...
class WidthToMarginConverter (line 198) | internal class WidthToMarginConverter : IValueConverter
method Convert (line 200) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 206) | public object ConvertBack(object value, Type targetType, object parame...
class HeightToMarginConverter (line 212) | internal class HeightToMarginConverter : IValueConverter
method Convert (line 214) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 220) | public object ConvertBack(object value, Type targetType, object parame...
class BooleanToVisibilityConverter (line 226) | internal class BooleanToVisibilityConverter : IValueConverter
method Convert (line 228) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 234) | public object ConvertBack(object value, Type targetType, object parame...
class MarginToWidthConverter (line 241) | internal class MarginToWidthConverter : IValueConverter
method Convert (line 243) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 249) | public object ConvertBack(object value, Type targetType, object parame...
class HeaderConverter (line 257) | internal class HeaderConverter : IMultiValueConverter
method Convert (line 259) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 265) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class IconFontSizeConverter (line 272) | internal class IconFontSizeConverter : IValueConverter
method Convert (line 274) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 279) | public object ConvertBack(object value, Type targetType, object parame...
class ScaleConverter (line 286) | internal class ScaleConverter : IMultiValueConverter
method Convert (line 288) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 295) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class ToggleHeightConverter (line 301) | internal class ToggleHeightConverter : IValueConverter
method Convert (line 303) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 308) | public object ConvertBack(object value, Type targetType, object parame...
class ToHalfConverter (line 315) | internal class ToHalfConverter : IValueConverter
method Convert (line 317) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 322) | public object ConvertBack(object value, Type targetType, object parame...
class ToggleTranslateXConverter (line 329) | internal class ToggleTranslateXConverter : IMultiValueConverter
method Convert (line 331) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 337) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class TextBoxInnerWidthConverter (line 344) | internal class TextBoxInnerWidthConverter : IMultiValueConverter
method Convert (line 346) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 355) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
class TextBoxInnerHeightConverter (line 362) | internal class TextBoxInnerHeightConverter : IMultiValueConverter
method Convert (line 364) | public object Convert(object[] values, Type targetType, object paramet...
method ConvertBack (line 373) | public object[] ConvertBack(object value, Type[] targetTypes, object p...
FILE: Panuon.UI/Z_Others/Enums.cs
type DropDownPlacement (line 20) | public enum DropDownPlacement
type ImageType (line 28) | public enum ImageType
type AnimationStyles (line 37) | public enum AnimationStyles
type ButtonStyles (line 56) | public enum ButtonStyles
type RepeatButtonStyles (line 82) | public enum RepeatButtonStyles
type ClickStyles (line 108) | public enum ClickStyles
type TextBoxStyles (line 123) | public enum TextBoxStyles
type PasswordBoxStyles (line 138) | public enum PasswordBoxStyles
type SelectedValuePaths (line 153) | public enum SelectedValuePaths
type ChoosedValuePaths (line 168) | public enum ChoosedValuePaths
type DeleteModes (line 183) | public enum DeleteModes
type SearchModes (line 198) | public enum SearchModes
type CheckBoxStyles (line 217) | public enum CheckBoxStyles
type RadioButtonStyles (line 244) | public enum RadioButtonStyles
type ProgressDirections (line 271) | public enum ProgressDirections
type ProgressBarStyles (line 294) | public enum ProgressBarStyles
type TreeViewStyles (line 309) | public enum TreeViewStyles
type ExpandModes (line 315) | public enum ExpandModes
type TabControlStyles (line 330) | public enum TabControlStyles
type DatePickerModes (line 339) | public enum DatePickerModes
type AnglePositions (line 358) | public enum AnglePositions
type Buttons (line 385) | public enum Buttons
type TextTypes (line 428) | public enum TextTypes
FILE: Panuon.UI/Z_Others/SkipCompareAttribute.cs
class SkipCompareAttribute (line 5) | [AttributeUsage(AttributeTargets.Property)]
FILE: Panuon.UI/Z_Utils/Extends.cs
class Extends (line 9) | public static class Extends
method ToSingleChineseNumber (line 15) | public static char ToSingleChineseNumber(this int number)
method ToSizeString (line 21) | public static string ToSizeString(this int byteSize)
method ToInt (line 46) | public static int ToInt(this string context)
method ToDouble (line 61) | public static double ToDouble(this string context)
method ToBoolean (line 76) | public static bool ToBoolean(this string context)
method ToTimeStamp (line 93) | public static long ToTimeStamp(this DateTime date)
method CompareYearMonthDay (line 102) | public static bool CompareYearMonthDay(this DateTime date1, DateTime d...
method ToDate (line 113) | public static DateTime ToDate(this long timeStamp)
method ToSizeString (line 118) | public static string ToSizeString(this long byteSize)
method ToString (line 144) | public static string ToString(this IList list, string spliter)
method ToObservableCollection (line 149) | public static ObservableCollection<T> ToObservableCollection<T>(this I...
method GetValues (line 164) | public static IEnumerable<KeyValuePair<TKey, TValue>> GetValues<TKey, ...
method IsEqual (line 180) | public static bool IsEqual<T>(this T obj, T value)
FILE: Panuon.UI/Z_Utils/Utils.cs
class TaskPoll (line 13) | public class TaskPoll
method Init (line 55) | public static void Init()
method Init (line 65) | public static void Init(int maxTaskQuantity)
method StartNew (line 75) | public static void StartNew(Task task)
method StartNew (line 87) | public static void StartNew<T>(Task<T> task)
method RecheckQueue (line 99) | private static void RecheckQueue()
class CachePoll (line 136) | public class CachePoll<TKey, TValue>
method CachePoll (line 142) | public CachePoll()
method CachePoll (line 151) | public CachePoll(TimeSpan ttl)
method CachePoll (line 161) | public CachePoll(TimeSpan ttl, TimeSpan collectInterval)
method ContainsKey (line 264) | public bool ContainsKey(TKey key)
method AddKey (line 274) | public void AddKey(TKey key)
method AddKeys (line 284) | public void AddKeys(IEnumerable<TKey> keys)
method AddOrUpdate (line 298) | public void AddOrUpdate(TKey key, TValue value)
method AddOrUpdates (line 311) | public void AddOrUpdates(IEnumerable<KeyValuePair<TKey, TValue>> keyVa...
method Get (line 332) | public TValue Get(TKey key)
method Get (line 353) | public TValue Get(TKey key, EventHandler lackItemCallback)
method GetAll (line 373) | public IEnumerable<KeyValuePair<TKey, TValue>> GetAll(IEnumerable<TKey...
method GetAll (line 392) | public IDictionary<TKey, TValue> GetAll(IEnumerable<TKey> keys, EventH...
method ReleaseCache (line 438) | public void ReleaseCache(TKey key)
method ReleaseCaches (line 446) | public void ReleaseCaches(IEnumerable<TKey> keys)
method Remove (line 457) | public void Remove(TKey key)
method RemoveAll (line 463) | public void RemoveAll(IEnumerable<TKey> keys)
method ChangeKey (line 472) | public bool ChangeKey(TKey oldKey, TKey newKey)
method Collect (line 493) | public void Collect()
method OnTick (line 525) | private void OnTick(object state)
method IsDefault (line 531) | private bool IsDefault( TValue value)
class CacheModel (line 539) | class CacheModel<T>
method CacheModel (line 542) | public CacheModel()
method CacheModel (line 547) | public CacheModel(T value)
class CacheNotExistsException (line 562) | public class CacheNotExistsException : Exception
method CacheNotExistsException (line 565) | public CacheNotExistsException()
method CacheNotExistsException (line 570) | public CacheNotExistsException(Modes mode)
type Modes (line 580) | public enum Modes
FILE: Panuon.UIBrowser/App.xaml.cs
class App (line 13) | public partial class App : Application
FILE: Panuon.UIBrowser/AppBootstrapper.cs
class AppBootstrapper (line 14) | public class AppBootstrapper : BootstrapperBase
method AppBootstrapper (line 18) | public AppBootstrapper()
method Configure (line 23) | protected override void Configure()
method OnUnhandledException (line 37) | protected override void OnUnhandledException(object sender, Dispatcher...
method GetInstance (line 43) | protected override object GetInstance(Type serviceType, string key)
method GetAllInstances (line 54) | protected override IEnumerable<object> GetAllInstances(Type serviceType)
method BuildUp (line 59) | protected override void BuildUp(object instance)
method OnStartup (line 64) | protected override void OnStartup(object sender, StartupEventArgs e)
FILE: Panuon.UIBrowser/IShell.cs
type IShell (line 8) | public interface IShell
FILE: Panuon.UIBrowser/Models/DataSourceModel.cs
class DataSourceModel (line 11) | public class DataSourceModel : INotifyPropertyChanged
method NotifyOfPropertyChange (line 15) | public void NotifyOfPropertyChange(string propertyName)
FILE: Panuon.UIBrowser/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: Panuon.UIBrowser/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: Panuon.UIBrowser/ViewModels/Chart/LineChartViewModel.cs
class LineChartViewModel (line 11) | public class LineChartViewModel : Screen, IShell
method LineChartViewModel (line 18) | public LineChartViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 108) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method AddItem (line 115) | public void AddItem()
method Init (line 122) | public async void Init()
method SetMaskCover (line 159) | public void SetMaskCover(bool toOpen)
method SetAwait (line 168) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/ButtonViewModel.cs
class ButtonViewModel (line 14) | public class ButtonViewModel : Screen, IShell
method ButtonViewModel (line 21) | public ButtonViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 103) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method StyleChanged (line 110) | public void StyleChanged(string content)
method ClickStyleChanged (line 115) | public void ClickStyleChanged(string content)
method BackgroundChanged (line 120) | public void BackgroundChanged(string content)
method ForegroundChanged (line 125) | public void ForegroundChanged(string content)
method CoverBrushChanged (line 129) | public void CoverBrushChanged(string content)
method Init (line 136) | private async void Init()
method SetMaskCover (line 155) | private void SetMaskCover(bool toOpen)
method SetAwait (line 164) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/CheckBoxViewModel.cs
class CheckBoxViewModel (line 14) | public class CheckBoxViewModel : Screen, IShell
method CheckBoxViewModel (line 21) | public CheckBoxViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 105) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method StyleChanged (line 112) | public void StyleChanged(string content)
method CoverBrushChanged (line 122) | public void CoverBrushChanged(string content)
method BorderBrushChanged (line 127) | public void BorderBrushChanged(string content)
method Init (line 135) | private async void Init()
method SetMaskCover (line 156) | private void SetMaskCover(bool toOpen)
method SetAwait (line 165) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/ComboBoxViewModel.cs
class ComboBoxViewModel (line 15) | public class ComboBoxViewModel : Screen, IShell
method ComboBoxViewModel (line 22) | public ComboBoxViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 161) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method AddItem (line 168) | public void AddItem()
method RemoveItem (line 178) | public void RemoveItem()
method SelectedBrushChanged (line 184) | public void SelectedBrushChanged(string content)
method CoverBrushChanged (line 189) | public void CoverBrushChanged(string content)
method ForegroundChanged (line 194) | public void ForegroundChanged(string content)
method ShadowColorChanged (line 199) | public void ShadowColorChanged(string content)
method BorderBrushChanged (line 204) | public void BorderBrushChanged(string content)
method SearchModeChanged (line 209) | public void SearchModeChanged(string content)
method DeleteModeChanged (line 214) | public void DeleteModeChanged(string content)
method DeleteItem (line 219) | public void DeleteItem(RoutedPropertyChangedEventArgs<PUComboBoxItem> e)
method Init (line 236) | private async void Init()
method SetMaskCover (line 274) | private void SetMaskCover(bool toOpen)
method SetAwait (line 283) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/ContextMenuViewModel.cs
class ContextMenuViewModel (line 14) | public class ContextMenuViewModel : Screen, IShell
method ContextMenuViewModel (line 21) | public ContextMenuViewModel(IWindowManager windowManager)
method TextBoxStyleChanged (line 116) | public void TextBoxStyleChanged(string content)
method BackgroundChanged (line 121) | public void BackgroundChanged(string content)
method ForegroundChanged (line 126) | public void ForegroundChanged(string content)
method CoverBrushChanged (line 131) | public void CoverBrushChanged(string content)
method ShadowColorChanged (line 136) | public void ShadowColorChanged(string content)
method BorderBrushChanged (line 141) | public void BorderBrushChanged(string content)
method HandleMouseWheel (line 149) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 159) | public async void Init()
method SetMaskCover (line 178) | public void SetMaskCover(bool toOpen)
method SetAwait (line 187) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/DatePickerViewModel.cs
class DatePickerViewModel (line 15) | public class DatePickerViewModel : Screen, IShell
method DatePickerViewModel (line 23) | public DatePickerViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 98) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method LimitMinDateTime (line 105) | public void LimitMinDateTime(bool toLimit)
method LimitMaxDateTime (line 117) | public void LimitMaxDateTime(bool toLimit)
method CoverBrushChanged (line 129) | public void CoverBrushChanged(string content)
method ForegroundChanged (line 134) | public void ForegroundChanged(string content)
method DatePickerModeChanged (line 139) | public void DatePickerModeChanged(string content)
method Init (line 147) | private async void Init()
method SetMaskCover (line 167) | private void SetMaskCover(bool toOpen)
method SetAwait (line 176) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/ListBoxViewModel.cs
class ListBoxViewModel (line 13) | public class ListBoxViewModel : Screen, IShell
method ListBoxViewModel (line 22) | public ListBoxViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 116) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method ListBoxLoaded (line 123) | public void ListBoxLoaded(object sender)
method Search (line 128) | public void Search()
method AddItem (line 138) | public void AddItem()
method RemoveItem (line 147) | public void RemoveItem()
method SelectedBrushChanged (line 153) | public void SelectedBrushChanged(string content)
method CoverBrushChanged (line 158) | public void CoverBrushChanged(string content)
method SearchBrushChanged (line 163) | public void SearchBrushChanged(string content)
method Init (line 170) | private async void Init()
method SetMaskCover (line 216) | private void SetMaskCover(bool toOpen)
method SetAwait (line 225) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/PasswordBoxViewModel.cs
class PasswordBoxViewModel (line 14) | public class PasswordBoxViewModel : Screen, IShell
method PasswordBoxViewModel (line 21) | public PasswordBoxViewModel(IWindowManager windowManager)
method PasswordBoxStyleChanged (line 108) | public void PasswordBoxStyleChanged(string content)
method BackgroundChanged (line 113) | public void BackgroundChanged(string content)
method ForegroundChanged (line 118) | public void ForegroundChanged(string content)
method ShadowColorChanged (line 123) | public void ShadowColorChanged(string content)
method BorderBrushChanged (line 128) | public void BorderBrushChanged(string content)
method HandleMouseWheel (line 136) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 146) | public async void Init()
method SetMaskCover (line 167) | public void SetMaskCover(bool toOpen)
method SetAwait (line 176) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/ProgressBarViewModel.cs
class ProgressBarViewModel (line 14) | public class ProgressBarViewModel : Screen, IShell
method ProgressBarViewModel (line 21) | public ProgressBarViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 159) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method StyleChanged (line 166) | public void StyleChanged(string content)
method CoverBrushChanged (line 171) | public void CoverBrushChanged(string content)
method BorderBrushChanged (line 176) | public void BorderBrushChanged(string content)
method BackgroundChanged (line 181) | public void BackgroundChanged(string content)
method ForegroundChanged (line 186) | public void ForegroundChanged(string content)
method Init (line 193) | private async void Init()
method SetMaskCover (line 218) | private void SetMaskCover(bool toOpen)
method SetAwait (line 227) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/RadioButtonViewModel.cs
class RadioButtonViewModel (line 14) | public class RadioButtonViewModel : Screen, IShell
method RadioButtonViewModel (line 21) | public RadioButtonViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 97) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method StyleChanged (line 104) | public void StyleChanged(string content)
method CoverBrushChanged (line 109) | public void CoverBrushChanged(string content)
method BorderBrushChanged (line 114) | public void BorderBrushChanged(string content)
method Init (line 122) | private async void Init()
method SetMaskCover (line 135) | private void SetMaskCover(bool toOpen)
method SetAwait (line 144) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/SliderViewModel.cs
class SliderViewModel (line 15) | public class SliderViewModel : Screen, IShell
method SliderViewModel (line 23) | public SliderViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 98) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method CoverBrushChanged (line 106) | public void CoverBrushChanged(string content)
method ForegroundChanged (line 111) | public void ForegroundChanged(string content)
method ShadowColorChanged (line 116) | public void ShadowColorChanged(string content)
method Init (line 124) | private async void Init()
method SetMaskCover (line 143) | private void SetMaskCover(bool toOpen)
method SetAwait (line 152) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/TabControlViewModel.cs
class TabControlViewModel (line 14) | public class TabControlViewModel : Screen, IShell
method TabControlViewModel (line 22) | public TabControlViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 115) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method AddItem (line 122) | public void AddItem()
method RemoveItem (line 133) | public void RemoveItem()
method StyleChanged (line 139) | public void StyleChanged(string content)
method SelectedBrushChanged (line 144) | public void SelectedBrushChanged(string content)
method ForegroundChanged (line 149) | public void ForegroundChanged(string content)
method BorderBrushChanged (line 154) | public void BorderBrushChanged(string content)
method Init (line 161) | private async void Init()
method SetMaskCover (line 198) | public void SetMaskCover(bool toOpen)
method SetAwait (line 207) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/TextBoxViewModel.cs
class TextBoxViewModel (line 14) | public class TextBoxViewModel : Screen, IShell
method TextBoxViewModel (line 21) | public TextBoxViewModel(IWindowManager windowManager)
method NumberLimit (line 116) | public void NumberLimit(bool isLimit)
method TextBoxStyleChanged (line 124) | public void TextBoxStyleChanged(string content)
method BackgroundChanged (line 129) | public void BackgroundChanged(string content)
method ForegroundChanged (line 134) | public void ForegroundChanged(string content)
method ShadowColorChanged (line 139) | public void ShadowColorChanged(string content)
method BorderBrushChanged (line 144) | public void BorderBrushChanged(string content)
method HandleMouseWheel (line 152) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 162) | public async void Init()
method SetMaskCover (line 182) | public void SetMaskCover(bool toOpen)
method SetAwait (line 191) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/TreeViewViewModel.cs
class TreeViewViewModel (line 17) | public class TreeViewViewModel : Screen, IShell
method TreeViewViewModel (line 24) | public TreeViewViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 115) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method AddItem (line 122) | public void AddItem()
method RemoveItem (line 136) | public void RemoveItem()
method SelectedBrushChanged (line 142) | public void SelectedBrushChanged(string content)
method CoverBrushChanged (line 147) | public void CoverBrushChanged(string content)
method ForegroundChanged (line 152) | public void ForegroundChanged(string content)
method StyleChanged (line 157) | public void StyleChanged(string content)
method ExpandModeChanged (line 162) | public void ExpandModeChanged(string content)
method Init (line 170) | private async void Init()
method SetMaskCover (line 234) | private void SetMaskCover(bool toOpen)
method SetAwait (line 243) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Control/WindowViewModel.cs
class WindowViewModel (line 12) | public class WindowViewModel : Screen, IShell
method WindowViewModel (line 19) | public WindowViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 53) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Display (line 64) | public void Display(int category)
method Init (line 114) | private async void Init()
method SetAwait (line 153) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Example.cs
class Example (line 16) | public class Example : Screen, IShell
method Example (line 23) | public Example(IWindowManager windowManager)
method HandleMouseWheel (line 59) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 69) | public async void Init()
method SetMaskCover (line 86) | public void SetMaskCover(bool toOpen)
method SetAwait (line 95) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/IntroductionViewModel.cs
class IntroductionViewModel (line 21) | public class IntroductionViewModel : Screen, IShell
method IntroductionViewModel (line 28) | public IntroductionViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 64) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 74) | public async void Init()
method SetMaskCover (line 91) | public void SetMaskCover(bool toOpen)
method SetAwait (line 100) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/MainWindowViewModel.cs
class MainWindowViewModel (line 10) | [Export(typeof(IShell))]
method MainWindowViewModel (line 14) | public MainWindowViewModel()
method ChangeSelect (line 19) | public void ChangeSelect(int select)
method ShowAwait (line 99) | public void ShowAwait()
method CloseAwait (line 103) | public void CloseAwait()
FILE: Panuon.UIBrowser/ViewModels/OverviewViewModel.cs
class OverviewViewModel (line 16) | public class OverviewViewModel : Screen, IShell
method OverviewViewModel (line 23) | public OverviewViewModel(IWindowManager windowManager)
method AddPercent (line 63) | public void AddPercent()
method ReducePercent (line 72) | public void ReducePercent()
method Detail (line 80) | public void Detail(string category)
method ChangeThemeBrush (line 90) | public void ChangeThemeBrush(RoutedPropertyChangedEventArgs<int> e)
method SetMaskCover (line 176) | public void SetMaskCover(bool toOpen)
method SetAwait (line 185) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Partial/BubblesViewModel.cs
class BubblesViewModel (line 11) | public class BubblesViewModel : Screen, IShell
method SelectionChanged (line 24) | public void SelectionChanged(SelectionChangedEventArgs e)
FILE: Panuon.UIBrowser/ViewModels/Partial/ButtonsViewModel.cs
class ButtonsViewModel (line 9) | public class ButtonsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/CheckBoxsViewModel.cs
class CheckBoxsViewModel (line 9) | public class CheckBoxsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/ComboBoxsViewModel.cs
class ComboBoxsViewModel (line 14) | public class ComboBoxsViewModel : Screen, IShell
method ComboBoxsViewModel (line 16) | public ComboBoxsViewModel()
method OnViewLoaded (line 21) | protected override void OnViewLoaded(object view)
method Delete (line 67) | public void Delete(ItemCollection sender, RoutedPropertyChangedEventAr...
method GetValue (line 76) | public void GetValue()
FILE: Panuon.UIBrowser/ViewModels/Partial/ContextMenusViewModel.cs
class ContextMenusViewModel (line 12) | public class ContextMenusViewModel : Screen, IShell
method Cut (line 25) | public void Cut()
method Copy (line 31) | public void Copy()
method Paste (line 37) | public void Paste()
FILE: Panuon.UIBrowser/ViewModels/Partial/DataGridsViewModel.cs
class DataGridsViewModel (line 17) | public class DataGridsViewModel : Screen, IShell
method DataGridsViewModel (line 19) | public DataGridsViewModel()
method Delete (line 43) | public void Delete(long id)
class ItemModel (line 52) | public class ItemModel : INotifyPropertyChanged
method NotifyOfPropertyChange (line 56) | public void NotifyOfPropertyChange(string propertyName)
method ItemModel (line 62) | public ItemModel() { }
method ItemModel (line 64) | public ItemModel(long id, string number, string name)
FILE: Panuon.UIBrowser/ViewModels/Partial/DatePickersViewModel.cs
class DatePickersViewModel (line 14) | public class DatePickersViewModel : Screen, IShell
method DatePickersViewModel (line 16) | public DatePickersViewModel()
method LimitMaxDate (line 76) | public void LimitMaxDate(bool toLimit)
method LimitMinDate (line 88) | public void LimitMinDate(bool toLimit)
method SelectionChanged (line 100) | public void SelectionChanged(SelectionChangedEventArgs e)
method DateTimeInputChanged (line 118) | public void DateTimeInputChanged()
FILE: Panuon.UIBrowser/ViewModels/Partial/GridsViewModel.cs
class GridsViewModel (line 11) | public class GridsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/ImageCuterViewModel.cs
class ImageCuterViewModel (line 15) | public class ImageCuterViewModel : Screen, IShell
method BtnSelectFile (line 37) | public void BtnSelectFile()
method ImageCuterLoaded (line 48) | public void ImageCuterLoaded(object sender)
method ImageLoaded (line 52) | public void ImageLoaded(object sender)
method BtnCut (line 56) | public void BtnCut()
method SelectionChanged (line 71) | public void SelectionChanged(object sender)
FILE: Panuon.UIBrowser/ViewModels/Partial/IntroductionViewModel.cs
class IntroductionViewModel (line 9) | public class IntroductionViewModel : Screen,IShell
method OpenWebsite (line 18) | public void OpenWebsite()
FILE: Panuon.UIBrowser/ViewModels/Partial/LineChartsViewModel.cs
class LineChartsViewModel (line 13) | public class LineChartsViewModel : Screen, IShell
method LineChartsViewModel (line 18) | public LineChartsViewModel()
method RandomValue (line 95) | public void RandomValue()
method ChangeAxis (line 129) | public void ChangeAxis()
method AddValues (line 149) | public void AddValues()
method ChangeColor (line 186) | public void ChangeColor()
method GetRandomDecimal1 (line 221) | private double GetRandomDecimal1()
method GetRandomDecimal2 (line 228) | private double GetRandomDecimal2()
FILE: Panuon.UIBrowser/ViewModels/Partial/ListBoxsViewModel.cs
class ListBoxsViewModel (line 10) | public class ListBoxsViewModel : Screen, IShell
method Search (line 15) | public void Search(string contentWord)
method ListBoxLoaded (line 26) | public void ListBoxLoaded(object sender)
FILE: Panuon.UIBrowser/ViewModels/Partial/PagingNavsViewModel.cs
class PagingNavsViewModel (line 9) | public class PagingNavsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/PasswordBoxsViewModel.cs
class PasswordBoxsViewModel (line 9) | public class PasswordBoxsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/ProgressBarsViewModel.cs
class ProgressBarsViewModel (line 9) | public class ProgressBarsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/RadioButtonsViewModel.cs
class RadioButtonsViewModel (line 9) | public class RadioButtonsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/SlidersViewModel.cs
class SlidersViewModel (line 9) | public class SlidersViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/SpecialViewModel.cs
class SpecialViewModel (line 9) | public class SpecialViewModel : Screen, IShell
method Switch (line 19) | public void Switch()
FILE: Panuon.UIBrowser/ViewModels/Partial/TabControlsViewModel.cs
class TabControlsViewModel (line 10) | public class TabControlsViewModel : Screen, IShell
method TabControlsViewModel (line 12) | public TabControlsViewModel()
FILE: Panuon.UIBrowser/ViewModels/Partial/TextBoxsViewModel.cs
class TextBoxsViewModel (line 9) | public class TextBoxsViewModel : Screen, IShell
FILE: Panuon.UIBrowser/ViewModels/Partial/TreeViewsViewModel.cs
class TreeViewsViewModel (line 14) | public class TreeViewsViewModel : Screen, IShell
method TreeViewsViewModel (line 16) | public TreeViewsViewModel()
method ChoosedItemChanged (line 53) | public void ChoosedItemChanged(RoutedPropertyChangedEventArgs<PUTreeVi...
method LoadTreeView (line 62) | public void LoadTreeView()
method SelectionChanged (line 121) | public void SelectionChanged(SelectionChangedEventArgs e)
FILE: Panuon.UIBrowser/ViewModels/Partial/UtilsViewModel.cs
class UtilsViewModel (line 23) | public class UtilsViewModel : Screen,IShell
method UtilsViewModel (line 28) | public UtilsViewModel()
method ListBoxLoaded (line 49) | public void ListBoxLoaded(object sender)
method Clear (line 54) | public void Clear()
method AddTask (line 64) | public void AddTask()
FILE: Panuon.UIBrowser/ViewModels/Partial/WindowsViewModel.cs
class WindowsViewModel (line 13) | public class WindowsViewModel : Screen, IShell
method OpenDialog (line 16) | public void OpenDialog(string type)
method ShowAwait (line 32) | public void ShowAwait()
FILE: Panuon.UIBrowser/ViewModels/ShellWindowViewModel.cs
class ShellWindowViewModel (line 11) | [Export(typeof(IShell))]
method ShellWindowViewModel (line 30) | [ImportingConstructor]
method BtnTest (line 36) | public void BtnTest()
method UpdateActivePage (line 57) | public void UpdateActivePage()
method GetCurrentWindow (line 139) | public Window GetCurrentWindow()
method ShowAwait (line 147) | public void ShowAwait()
method CloseAwait (line 155) | public void CloseAwait()
method ShowCoverMask (line 163) | public void ShowCoverMask()
method CloseCoverMask (line 171) | public void CloseCoverMask()
FILE: Panuon.UIBrowser/ViewModels/Special/BubbleViewModel.cs
class BubbleViewModel (line 20) | public class BubbleViewModel : Screen, IShell
method BubbleViewModel (line 27) | public BubbleViewModel(IWindowManager windowManager)
method AnglePositionChanged (line 92) | public void AnglePositionChanged(string content)
method BackgroundChanged (line 98) | public void BackgroundChanged(string content)
method CoverBrushChanged (line 103) | public void CoverBrushChanged(string content)
method HandleMouseWheel (line 111) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method Init (line 121) | public async void Init()
method SetMaskCover (line 136) | public void SetMaskCover(bool toOpen)
method SetAwait (line 145) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Special/DropDownViewModel.cs
class DropDownViewModel (line 12) | public class DropDownViewModel : Screen, IShell
method DropDownViewModel (line 19) | public DropDownViewModel(IWindowManager windowManager)
FILE: Panuon.UIBrowser/ViewModels/Special/ImageCuterViewModel.cs
class ImageCuterViewModel (line 12) | public class ImageCuterViewModel : Screen, IShell
method ImageCuterViewModel (line 23) | public ImageCuterViewModel(IWindowManager windowManager)
method BtnSelectFile (line 54) | public void BtnSelectFile()
method ImageCuterLoaded (line 64) | public void ImageCuterLoaded(object sender)
method ImageLoaded (line 69) | public void ImageLoaded(object sender)
method BtnCut (line 74) | public void BtnCut()
method SelectionChanged (line 84) | public void SelectionChanged(object sender)
FILE: Panuon.UIBrowser/ViewModels/Special/LoadingViewModel.cs
class LoadingViewModel (line 8) | public class LoadingViewModel : Screen, IShell
method LoadingViewModel (line 15) | public LoadingViewModel(IWindowManager windowManager)
method Init (line 34) | public async void Init()
method SetMaskCover (line 43) | public void SetMaskCover(bool toOpen)
method SetAwait (line 52) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Special/PagingNavViewModel.cs
class PagingNavViewModel (line 15) | public class PagingNavViewModel : Screen, IShell
method PagingNavViewModel (line 22) | public PagingNavViewModel(IWindowManager windowManager)
method HandleMouseWheel (line 97) | public void HandleMouseWheel(object sender, MouseWheelEventArgs e)
method SelectedBrushChanged (line 104) | public void SelectedBrushChanged(string content)
method ButtonBrushChanged (line 109) | public void ButtonBrushChanged(string content)
method Init (line 117) | private async void Init()
method SetMaskCover (line 135) | private void SetMaskCover(bool toOpen)
method SetAwait (line 144) | private void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/ViewModels/Special/ResizeGridViewModel.cs
class ResizeGridViewModel (line 5) | public class ResizeGridViewModel : Screen, IShell
method ResizeGridViewModel (line 12) | public ResizeGridViewModel(IWindowManager windowManager)
FILE: Panuon.UIBrowser/ViewModels/Special/SplitLineViewModel.cs
class SplitLineViewModel (line 8) | public class SplitLineViewModel : Screen, IShell
method SplitLineViewModel (line 15) | public SplitLineViewModel(IWindowManager windowManager)
method Init (line 33) | public async void Init()
method SetMaskCover (line 42) | public void SetMaskCover(bool toOpen)
method SetAwait (line 51) | public void SetAwait(bool toOpen)
FILE: Panuon.UIBrowser/Views/Controls/Examples/ChatWindow.xaml.cs
class ChatWindow (line 23) | public partial class ChatWindow : PUWindow
method ChatWindow (line 29) | public ChatWindow()
method btnSend_Click (line 36) | private async void btnSend_Click(object sender, System.Windows.RoutedE...
method btnClose_Click (line 47) | private void btnClose_Click(object sender, System.Windows.RoutedEventA...
method Init (line 54) | public void Init()
method GetBubbleGrid (line 59) | private Grid GetBubbleGrid(string content, bool isTopOne = false, bool...
FILE: Panuon.UIBrowser/Views/Controls/Examples/LoginWindow.xaml.cs
class LoginWindow (line 16) | public partial class LoginWindow : PUWindow
method LoginWindow (line 18) | public LoginWindow()
method Login_Click (line 23) | private void Login_Click(object sender, RoutedEventArgs e)
FILE: Panuon.UIBrowser/Views/Controls/Examples/MultiNavWindow.xaml.cs
class MultiNavWindow (line 18) | public partial class MultiNavWindow : PUWindow
method MultiNavWindow (line 20) | public MultiNavWindow()
method LoadNavButtons (line 28) | public void LoadNavButtons()
Condensed preview — 234 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,555K chars).
[
{
"path": ".gitignore",
"chars": 197,
"preview": "*.suo \n\n*.user \n\n*.userosscache \n\n*.sln.docstates\n\n*.userprefs\n\n*.pdb\n\n*.dll\n\n*.cache\n\n[Dd]ebug/\n\n[Dd]ebugPublic/\n\n[R"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "Panuon.UI/0_Base/DragableThumb.cs",
"chars": 2682,
"preview": "using System;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.W"
},
{
"path": "Panuon.UI/0_Base/NotTopMostPopup.cs",
"chars": 1935,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.T"
},
{
"path": "Panuon.UI/0_Base/PUResizeContainer.cs",
"chars": 1432,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\nnamespace Panuon.UI\n{\n internal class PUResizeContainer : Cont"
},
{
"path": "Panuon.UI/0_Base/PUResizeGrid.cs",
"chars": 716,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\n\nnamespace Panuon.UI\n{\n public class PUResizeGrid : UserContro"
},
{
"path": "Panuon.UI/0_Base/PUResizeThumb.cs",
"chars": 6410,
"preview": "using System;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.W"
},
{
"path": "Panuon.UI/0_Base/PUWindow.cs",
"chars": 26471,
"preview": "using System;\nusing System.ComponentModel;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System."
},
{
"path": "Panuon.UI/2_Button/PUButton.cs",
"chars": 2668,
"preview": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n public clas"
},
{
"path": "Panuon.UI/2_Button/PURepeatButton.cs",
"chars": 2445,
"preview": "using System.Windows;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n "
},
{
"path": "Panuon.UI/3_TextBox/PUTextBox.cs",
"chars": 9189,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n "
},
{
"path": "Panuon.UI/4_PasswordBox/PUPasswordBox.cs",
"chars": 10326,
"preview": "using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.In"
},
{
"path": "Panuon.UI/5_ComboBox/PUComboBox.cs",
"chars": 17566,
"preview": "using Panuon.UI.Utils;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collectio"
},
{
"path": "Panuon.UI/5_ComboBox/PUComboBoxItem.cs",
"chars": 2677,
"preview": "using System;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nname"
},
{
"path": "Panuon.UI/6_CheckBox/PUCheckBox.cs",
"chars": 2775,
"preview": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n public clas"
},
{
"path": "Panuon.UI/7_RadioButton/PURadioButton.cs",
"chars": 2878,
"preview": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n public clas"
},
{
"path": "Panuon.UI/8_ProgressBar/PUProgressBar.cs",
"chars": 8619,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Windows.Med"
},
{
"path": "Panuon.UI/9_Special/Countdown.cs",
"chars": 3970,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Threading;\n\nnamespace Panuon.UI"
},
{
"path": "Panuon.UI/9_Special/DateTimePicker.cs",
"chars": 4852,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.Windows"
},
{
"path": "Panuon.UI/9_Special/DropDown.cs",
"chars": 2269,
"preview": "using System;\nusing System.Collections.ObjectModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.W"
},
{
"path": "Panuon.UI/9_Special/PUCard.cs",
"chars": 4188,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n "
},
{
"path": "Panuon.UI/9_Special/PUImageCuter.xaml",
"chars": 4837,
"preview": "<UserControl x:Class=\"Panuon.UI.PUImageCuter\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presenta"
},
{
"path": "Panuon.UI/9_Special/PUImageCuter.xaml.cs",
"chars": 4377,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows;\nusing Syste"
},
{
"path": "Panuon.UI/9_Special/PUIndicator.xaml",
"chars": 905,
"preview": "<UserControl x:Class=\"Panuon.UI.PUIndicator\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentat"
},
{
"path": "Panuon.UI/9_Special/PUIndicator.xaml.cs",
"chars": 10078,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Med"
},
{
"path": "Panuon.UI/9_Special/PULoading.xaml",
"chars": 558,
"preview": "<UserControl x:Class=\"Panuon.UI.PULoading\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentatio"
},
{
"path": "Panuon.UI/9_Special/PULoading.xaml.cs",
"chars": 5480,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Windows.Med"
},
{
"path": "Panuon.UI/9_Special/PUMessageBox.xaml",
"chars": 3537,
"preview": "<pu:PUWindow x:Class=\"Panuon.UI.PUMessageBox\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presenta"
},
{
"path": "Panuon.UI/9_Special/PUMessageBox.xaml.cs",
"chars": 8228,
"preview": "using System;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System."
},
{
"path": "Panuon.UI/9_Special/PUSlideShow.xaml",
"chars": 1992,
"preview": "<UserControl x:Class=\"Panuon.UI.PUSlideShow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentat"
},
{
"path": "Panuon.UI/9_Special/PUSlideShow.xaml.cs",
"chars": 14343,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Markup;\nusing System.Windows.Me"
},
{
"path": "Panuon.UI/9_Special/PUSplitLine.cs",
"chars": 930,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\nnamespace Panuon.UI\n{\n public class PUSplitLine : Control\n "
},
{
"path": "Panuon.UI/A0_TreeView/PUTreeView.cs",
"chars": 19339,
"preview": "using Panuon.UI.Utils;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collectio"
},
{
"path": "Panuon.UI/A0_TreeView/PUTreeViewItem.cs",
"chars": 3610,
"preview": "using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Me"
},
{
"path": "Panuon.UI/A1_Slider/PUSlider.xaml",
"chars": 1787,
"preview": "<UserControl x:Class=\"Panuon.UI.PUSlider\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
},
{
"path": "Panuon.UI/A1_Slider/PUSlider.xaml.cs",
"chars": 5711,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n "
},
{
"path": "Panuon.UI/A2_TabControl/PUTabControl.cs",
"chars": 18921,
"preview": "using Panuon.UI.Utils;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collectio"
},
{
"path": "Panuon.UI/A2_TabControl/PUTabItem.cs",
"chars": 3151,
"preview": "using System;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nname"
},
{
"path": "Panuon.UI/A3_ListBox/PUListBox.cs",
"chars": 11832,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusi"
},
{
"path": "Panuon.UI/A3_ListBox/PUListBoxItem.cs",
"chars": 1550,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\n\nnamespace Panuon.UI\n{\n public class PUListBoxItem : ListBoxIt"
},
{
"path": "Panuon.UI/A4_DatePicker/PUDatePicker.xaml",
"chars": 21493,
"preview": "<UserControl x:Class=\"Panuon.UI.PUDatePicker\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presenta"
},
{
"path": "Panuon.UI/A4_DatePicker/PUDatePicker.xaml.cs",
"chars": 37089,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Medi"
},
{
"path": "Panuon.UI/A5_PagingNav/PUPagingNav.xaml",
"chars": 2391,
"preview": "<UserControl x:Class=\"Panuon.UI.PUPagingNav\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentat"
},
{
"path": "Panuon.UI/A5_PagingNav/PUPagingNav.xaml.cs",
"chars": 11179,
"preview": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Media;\n\nnamespace "
},
{
"path": "Panuon.UI/A6_ContextMenu/PUContextMenu.cs",
"chars": 2294,
"preview": "using System;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Control"
},
{
"path": "Panuon.UI/A6_ContextMenu/PUContextMenuItem.cs",
"chars": 700,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\nnamespace Panuon.UI\n{\n public class PUContextMenuItem : MenuIt"
},
{
"path": "Panuon.UI/A7_Bubble/PUBubble.cs",
"chars": 1839,
"preview": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Panuon.UI\n{\n public clas"
},
{
"path": "Panuon.UI/Helper/Helper.cs",
"chars": 4173,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\n\nnamespace Panuon.UI\n{\n public class Helper : DependencyObject"
},
{
"path": "Panuon.UI/Others/Enums.cs",
"chars": 4960,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/19 11:09:29\n*说明: \n*日志:2018/11/19"
},
{
"path": "Panuon.UI/Panuon.UI.csproj",
"chars": 8101,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbu"
},
{
"path": "Panuon.UI/Properties/AssemblyInfo.cs",
"chars": 1720,
"preview": "using System.Reflection;\r\nusing System.Resources;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.Interop"
},
{
"path": "Panuon.UI/Properties/Resources.Designer.cs",
"chars": 2508,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// 此代码由工具生成。"
},
{
"path": "Panuon.UI/Properties/Resources.resx",
"chars": 5610,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<root>\r\n <!-- \r\n Microsoft ResX Schema \r\n \r\n Version 2.0\r\n \r\n T"
},
{
"path": "Panuon.UI/Properties/Settings.Designer.cs",
"chars": 1001,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// 此代码由工具生成。"
},
{
"path": "Panuon.UI/Properties/Settings.settings",
"chars": 199,
"preview": "<?xml version='1.0' encoding='utf-8'?>\r\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\r\n <Profiles>\r\n "
},
{
"path": "Panuon.UI/Themes/Control.xaml",
"chars": 43430,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http"
},
{
"path": "Panuon.UI/Themes/Generic.xaml",
"chars": 474249,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n xmlns:x=\"htt"
},
{
"path": "Panuon.UI/Themes/Resources.xaml",
"chars": 572,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http"
},
{
"path": "Panuon.UI/Utils/Converters.cs",
"chars": 14566,
"preview": "using System;\nusing System.Globalization;\nusing System.Windows;\nusing System.Windows.Data;\nusing System.Windows.Media;\n"
},
{
"path": "Panuon.UI/Utils/Extends.cs",
"chars": 2236,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Panuon.UI.Utils\n{\n "
},
{
"path": "Panuon.UI/Utils/Utils.cs",
"chars": 6664,
"preview": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Th"
},
{
"path": "Panuon.UI/Z_Helper/Helper.cs",
"chars": 5147,
"preview": "using System.Windows;\nusing System.Windows.Controls;\n\n\nnamespace Panuon.UI\n{\n public class Helper : DependencyObject"
},
{
"path": "Panuon.UI/Z_Models/PUComboBoxItemModel.cs",
"chars": 1758,
"preview": "using System;\nusing System.ComponentModel;\n\nnamespace Panuon.UI\n{\n public class PUComboBoxItemModel : INotifyPropert"
},
{
"path": "Panuon.UI/Z_Models/PUListBoxItemModel.cs",
"chars": 1688,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Windows;\n\nnamespace Panuon.UI"
},
{
"path": "Panuon.UI/Z_Models/PUTabItemModel.cs",
"chars": 2495,
"preview": "using System;\nusing System.ComponentModel;\n\nnamespace Panuon.UI\n{\n public class PUTabItemModel : INotifyPropertyChan"
},
{
"path": "Panuon.UI/Z_Models/PUTreeViewItemModel.cs",
"chars": 2643,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Windows;\n\nnamespace Panuon.UI"
},
{
"path": "Panuon.UI/Z_Others/Converters.cs",
"chars": 17344,
"preview": "using System;\nusing System.Globalization;\nusing System.Windows;\nusing System.Windows.Data;\nusing System.Windows.Media;\n"
},
{
"path": "Panuon.UI/Z_Others/Enums.cs",
"chars": 9639,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/19 11:09:29\n*说明: \n*日志:2018/11/19"
},
{
"path": "Panuon.UI/Z_Others/SkipCompareAttribute.cs",
"chars": 151,
"preview": "using System;\n\nnamespace Panuon.UI\n{\n [AttributeUsage(AttributeTargets.Property)]\n public class SkipCompareAttrib"
},
{
"path": "Panuon.UI/Z_Utils/Extends.cs",
"chars": 7115,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing S"
},
{
"path": "Panuon.UI/Z_Utils/Utils.cs",
"chars": 16951,
"preview": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Th"
},
{
"path": "Panuon.UI.Charts/0_Base/PUChartPoint.cs",
"chars": 561,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Collections"
},
{
"path": "Panuon.UI.Charts/0_Base/PUChartToolTip.xaml",
"chars": 1641,
"preview": "<UserControl x:Class=\"Panuon.UI.Charts.PUChartToolTip\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml"
},
{
"path": "Panuon.UI.Charts/0_Base/PUChartToolTip.xaml.cs",
"chars": 1833,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows;\nusing Syste"
},
{
"path": "Panuon.UI.Charts/1_LineChart/PULineChart.cs",
"chars": 2618,
"preview": "using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Windows.Med"
},
{
"path": "Panuon.UI.Charts/1_LineChart/PULineChart.xaml",
"chars": 3224,
"preview": "<UserControl x:Class=\"Panuon.UI.Charts.PULineChart\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/pr"
},
{
"path": "Panuon.UI.Charts/1_LineChart/PULineChart.xaml.cs",
"chars": 17673,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Speciali"
},
{
"path": "Panuon.UI.Charts/Others/Enums.cs",
"chars": 691,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/30 10:02:45\n*说明: \n*日志:2018/11/30"
},
{
"path": "Panuon.UI.Charts/Panuon.UI.Charts.csproj",
"chars": 3376,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Panuon.UI.Charts/Properties/AssemblyInfo.cs",
"chars": 953,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// 有关程序集的一般信息由以下"
},
{
"path": "Panuon.UI.sln",
"chars": 2125,
"preview": "\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 14\r\nVisualStudioVersion = 14.0.25420.1\r\n"
},
{
"path": "Panuon.UIBrowser/App.xaml",
"chars": 802,
"preview": "<Application x:Class=\"Panuon.UIBrowser.App\"\r\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentat"
},
{
"path": "Panuon.UIBrowser/App.xaml.cs",
"chars": 300,
"preview": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Configuration;\r\nusing System.Data;\r\nusing System.Linq;\r\n"
},
{
"path": "Panuon.UIBrowser/AppBootstrapper.cs",
"chars": 2237,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Composition;\nusing System.ComponentModel.Co"
},
{
"path": "Panuon.UIBrowser/IShell.cs",
"chars": 159,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Panuon.UIBrowser\n{\n "
},
{
"path": "Panuon.UIBrowser/Models/DataSourceModel.cs",
"chars": 1661,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/15 13:16:48\n*说明: 用于显示属性描述。\n*日志:2"
},
{
"path": "Panuon.UIBrowser/Panuon.UIBrowser.csproj",
"chars": 12511,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micro"
},
{
"path": "Panuon.UIBrowser/Properties/AssemblyInfo.cs",
"chars": 1624,
"preview": "using System.Reflection;\r\nusing System.Resources;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.Interop"
},
{
"path": "Panuon.UIBrowser/Properties/Resources.Designer.cs",
"chars": 2522,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// 此代码由工具生成。"
},
{
"path": "Panuon.UIBrowser/Properties/Resources.resx",
"chars": 5610,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<root>\r\n <!-- \r\n Microsoft ResX Schema \r\n \r\n Version 2.0\r\n \r\n T"
},
{
"path": "Panuon.UIBrowser/Properties/Settings.Designer.cs",
"chars": 1008,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// 此代码由工具生成。"
},
{
"path": "Panuon.UIBrowser/Properties/Settings.settings",
"chars": 199,
"preview": "<?xml version='1.0' encoding='utf-8'?>\r\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\r\n <Profiles>\r\n "
},
{
"path": "Panuon.UIBrowser/ViewModels/Chart/LineChartViewModel.cs",
"chars": 5527,
"preview": "using Caliburn.Micro;\nusing Panuon.UI.Charts;\nusing Panuon.UIBrowser.Models;\nusing System.Collections.ObjectModel;\nusin"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/ButtonViewModel.cs",
"chars": 6623,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/CheckBoxViewModel.cs",
"chars": 6577,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/ComboBoxViewModel.cs",
"chars": 11983,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/ContextMenuViewModel.cs",
"chars": 7366,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/DatePickerViewModel.cs",
"chars": 6276,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/ListBoxViewModel.cs",
"chars": 9688,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/PasswordBoxViewModel.cs",
"chars": 7319,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/ProgressBarViewModel.cs",
"chars": 9094,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/RadioButtonViewModel.cs",
"chars": 5390,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/SliderViewModel.cs",
"chars": 5363,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/TabControlViewModel.cs",
"chars": 9685,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/TextBoxViewModel.cs",
"chars": 7492,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/TreeViewViewModel.cs",
"chars": 11054,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UI.Utils;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System"
},
{
"path": "Panuon.UIBrowser/ViewModels/Control/WindowViewModel.cs",
"chars": 8606,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System.Collections.ObjectModel;\nusing Syste"
},
{
"path": "Panuon.UIBrowser/ViewModels/Example.cs",
"chars": 3296,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/15 13:12:35\n*说明: 样板。\n*日志:2018/11"
},
{
"path": "Panuon.UIBrowser/ViewModels/IntroductionViewModel.cs",
"chars": 3422,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/12/21 15:24:39\n*说明: \n*日志:2018/12/21"
},
{
"path": "Panuon.UIBrowser/ViewModels/MainWindowViewModel.cs",
"chars": 3504,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.ViewModels.Partial;\nusing System;\nusing System.ComponentM"
},
{
"path": "Panuon.UIBrowser/ViewModels/OverviewViewModel.cs",
"chars": 7475,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.Generic;\nu"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/BubblesViewModel.cs",
"chars": 1459,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ButtonsViewModel.cs",
"chars": 223,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/CheckBoxsViewModel.cs",
"chars": 225,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ComboBoxsViewModel.cs",
"chars": 2368,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectM"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ContextMenusViewModel.cs",
"chars": 859,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/DataGridsViewModel.cs",
"chars": 2542,
"preview": "using Caliburn.Micro;\nusing Microsoft.Win32;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing Sys"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/DatePickersViewModel.cs",
"chars": 4031,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UI.Utils;\nusing System;\nusing System.Collections.Generic;\nusing Sys"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/GridsViewModel.cs",
"chars": 278,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ImageCuterViewModel.cs",
"chars": 2536,
"preview": "using Caliburn.Micro;\nusing Microsoft.Win32;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing Sys"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/IntroductionViewModel.cs",
"chars": 613,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/LineChartsViewModel.cs",
"chars": 9250,
"preview": "using Caliburn.Micro;\nusing Panuon.UI.Charts;\nusing System;\nusing System.Collections.Generic;\nusing System.Collections."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ListBoxsViewModel.cs",
"chars": 675,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/PagingNavsViewModel.cs",
"chars": 649,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/PasswordBoxsViewModel.cs",
"chars": 660,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/ProgressBarsViewModel.cs",
"chars": 228,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/RadioButtonsViewModel.cs",
"chars": 228,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/SlidersViewModel.cs",
"chars": 410,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/SpecialViewModel.cs",
"chars": 519,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/TabControlsViewModel.cs",
"chars": 1386,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System."
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/TextBoxsViewModel.cs",
"chars": 437,
"preview": "using Caliburn.Micro;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace "
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/TreeViewsViewModel.cs",
"chars": 4310,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectM"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/UtilsViewModel.cs",
"chars": 2635,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/5 17:49:13\n*说明: \n*日志:2018/11/5 1"
},
{
"path": "Panuon.UIBrowser/ViewModels/Partial/WindowsViewModel.cs",
"chars": 1354,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Views.Partial;\nusing System;\nusing System.Collections.Gen"
},
{
"path": "Panuon.UIBrowser/ViewModels/ShellWindowViewModel.cs",
"chars": 5662,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UI.Utils;\nusing System;\nusing System.ComponentModel.Composition;\nus"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/BubbleViewModel.cs",
"chars": 5342,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/15 13:12:35\n*说明: 样板。\n*日志:2018/11"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/DropDownViewModel.cs",
"chars": 651,
"preview": "using Caliburn.Micro;\nusing Microsoft.Win32;\nusing Panuon.UI;\nusing System;\nusing System.IO;\nusing System.Windows;\nusin"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/ImageCuterViewModel.cs",
"chars": 2555,
"preview": "using Caliburn.Micro;\nusing Microsoft.Win32;\nusing Panuon.UI;\nusing System;\nusing System.IO;\nusing System.Windows;\nusin"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/LoadingViewModel.cs",
"chars": 1760,
"preview": "using Caliburn.Micro;\nusing Panuon.UIBrowser.Models;\nusing System.Collections.ObjectModel;\nusing System.Threading.Tasks"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/PagingNavViewModel.cs",
"chars": 5492,
"preview": "using Caliburn.Micro;\nusing Panuon.UI;\nusing Panuon.UIBrowser.Models;\nusing System;\nusing System.Collections.ObjectMode"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/ResizeGridViewModel.cs",
"chars": 409,
"preview": "using Caliburn.Micro;\n\nnamespace Panuon.UIBrowser.ViewModels.Special\n{\n public class ResizeGridViewModel : Screen, I"
},
{
"path": "Panuon.UIBrowser/ViewModels/Special/SplitLineViewModel.cs",
"chars": 1791,
"preview": "using Caliburn.Micro;\nusing Panuon.UIBrowser.Models;\nusing System.Collections.ObjectModel;\nusing System.Threading.Tasks"
},
{
"path": "Panuon.UIBrowser/Views/Chart/LineChartView.xaml",
"chars": 31140,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Chart.LineChartView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Controls/ButtonView.xaml",
"chars": 28168,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.ButtonView\"\n xmlns=\"http://schemas.microsoft.com/winfx"
},
{
"path": "Panuon.UIBrowser/Views/Controls/CheckBoxView.xaml",
"chars": 22896,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.CheckBoxView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Controls/ComboBoxView.xaml",
"chars": 41503,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.ComboBoxView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Controls/ContextMenuView.xaml",
"chars": 24552,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.ContextMenuView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Controls/DatePickerView.xaml",
"chars": 21331,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.DatePickerView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/ChatWindow.xaml",
"chars": 3116,
"preview": "<pu:PUWindow x:Class=\"Panuon.UIBrowser.Views.Control.Examples.ChatWindow\"\n xmlns=\"http://schemas.microsoft."
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/ChatWindow.xaml.cs",
"chars": 4317,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/16 14:51:55\n*说明: \n*日志:2018/11/16"
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/LoginWindow.xaml",
"chars": 2586,
"preview": "<pu:PUWindow x:Class=\"Panuon.UIBrowser.Views.Control.Examples.LoginWindow\"\n xmlns=\"http://schemas.microsoft"
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/LoginWindow.xaml.cs",
"chars": 616,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/16 14:11:41\n*说明: \n*日志:2018/11/16"
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/MultiNavWindow.xaml",
"chars": 892,
"preview": "<pu:PUWindow x:Class=\"Panuon.UIBrowser.Views.Control.Examples.MultiNavWindow\"\n xmlns=\"http://schemas.micros"
},
{
"path": "Panuon.UIBrowser/Views/Controls/Examples/MultiNavWindow.xaml.cs",
"chars": 1686,
"preview": "/*==============================================================\n*作者:ZEOUN\n*时间:2018/11/16 9:32:52\n*说明: \n*日志:2018/11/16 "
},
{
"path": "Panuon.UIBrowser/Views/Controls/ListBoxView.xaml",
"chars": 31445,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.ListBoxView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Controls/PasswordBoxView.xaml",
"chars": 31676,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.PasswordBoxView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Controls/ProgressBarView.xaml",
"chars": 38851,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.ProgressBarView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Controls/RadioButtonView.xaml",
"chars": 21775,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.RadioButtonView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Controls/SliderView.xaml",
"chars": 18345,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.SliderView\"\n xmlns=\"http://schemas.microsoft.com/winfx"
},
{
"path": "Panuon.UIBrowser/Views/Controls/TabControlView.xaml",
"chars": 28079,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.TabControlView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Controls/TextBoxView.xaml",
"chars": 32432,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.TextBoxView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Controls/TreeViewView.xaml",
"chars": 30031,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.TreeViewView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Controls/WindowView.xaml",
"chars": 9859,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Control.WindowView\"\n xmlns=\"http://schemas.microsoft.com/winfx"
},
{
"path": "Panuon.UIBrowser/Views/MainWindowView.xaml",
"chars": 13052,
"preview": "<pu:PUWindow x:Class=\"Panuon.UIBrowser.Views.MainWindowView\"\n xmlns=\"http://schemas.microsoft.com/winfx/200"
},
{
"path": "Panuon.UIBrowser/Views/OverviewView.xaml",
"chars": 23242,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.OverviewView\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/"
},
{
"path": "Panuon.UIBrowser/Views/Partial/BubblesView.xaml",
"chars": 3421,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.BubblesView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ButtonsView.xaml",
"chars": 16823,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ButtonsView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Partial/CheckBoxsView.xaml",
"chars": 11818,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.CheckBoxsView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ComboBoxsView.xaml",
"chars": 11540,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ComboBoxsView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ContextMenusView.xaml",
"chars": 4501,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ContextMenusView\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Panuon.UIBrowser/Views/Partial/DataGridsView.xaml",
"chars": 3488,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.DataGridsView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Partial/DatePickersView.xaml",
"chars": 4807,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.DatePickersView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Partial/HelpersView.xaml",
"chars": 3339,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.GridsView\"\n xmlns=\"http://schemas.microsoft.com/winfx/"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ImageCuterView.xaml",
"chars": 3931,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ImageCuterView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Partial/IntroductionView.xaml",
"chars": 1949,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.IntroductionView\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Panuon.UIBrowser/Views/Partial/LineChartsView.xaml",
"chars": 3477,
"preview": "<UserControl xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.mic"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ListBoxsView.xaml",
"chars": 4799,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ListBoxsView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Partial/PagingNavsView.xaml",
"chars": 4721,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.PagingNavsView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Partial/PasswordBoxsView.xaml",
"chars": 10546,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.PasswordBoxsView\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Panuon.UIBrowser/Views/Partial/ProgressBarsView.xaml",
"chars": 13371,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.ProgressBarsView\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Panuon.UIBrowser/Views/Partial/RadioButtonsView.xaml",
"chars": 14143,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.RadioButtonsView\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "Panuon.UIBrowser/Views/Partial/SlidersView.xaml",
"chars": 4533,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.SlidersView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Partial/SpecialView.xaml",
"chars": 5929,
"preview": "<UserControl xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.mic"
},
{
"path": "Panuon.UIBrowser/Views/Partial/TabControlsView.xaml",
"chars": 5536,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.TabControlsView\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "Panuon.UIBrowser/Views/Partial/TextBoxsView.xaml",
"chars": 10838,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.TextBoxsView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Partial/TreeViewsView.xaml",
"chars": 7977,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.TreeViewsView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Partial/UtilsView.xaml",
"chars": 4741,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.UtilsView\"\n xmlns=\"http://schemas.microsoft.com/winfx/"
},
{
"path": "Panuon.UIBrowser/Views/Partial/WindowsView.xaml",
"chars": 3464,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Partial.WindowsView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/ShellWindowView.xaml",
"chars": 8142,
"preview": "<pu:PUWindow x:Class=\"Panuon.UIBrowser.Views.ShellWindowView\"\n xmlns=\"http://schemas.microsoft.com/winfx/20"
},
{
"path": "Panuon.UIBrowser/Views/Special/BubbleView.xaml",
"chars": 19894,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.BubbleView\"\n xmlns=\"http://schemas.microsoft.com/winfx"
},
{
"path": "Panuon.UIBrowser/Views/Special/DropDownView.xaml",
"chars": 6406,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.DropDownView\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "Panuon.UIBrowser/Views/Special/ImageCuterView.xaml",
"chars": 3919,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.ImageCuterView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Special/IndicatorView.xaml",
"chars": 3708,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.IndicatorView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Special/LoadingView.xaml",
"chars": 3422,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.LoadingView\"\n xmlns=\"http://schemas.microsoft.com/winf"
},
{
"path": "Panuon.UIBrowser/Views/Special/PagingNavView.xaml",
"chars": 26443,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.PagingNavView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/Views/Special/ResizeGridView.xaml",
"chars": 1320,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.ResizeGridView\"\n xmlns=\"http://schemas.microsoft.com/w"
},
{
"path": "Panuon.UIBrowser/Views/Special/SplitLineView.xaml",
"chars": 3707,
"preview": "<UserControl x:Class=\"Panuon.UIBrowser.Views.Special.SplitLineView\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "Panuon.UIBrowser/app.config",
"chars": 158,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Vers"
},
{
"path": "Panuon.UIBrowser/packages.config",
"chars": 273,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Caliburn.Micro\" version=\"3.2.0\" targetFramework=\"net40"
},
{
"path": "README.md",
"chars": 8377,
"preview": "# PanuonUI(v1.0.0 alpha)\n\n### 本项目已停止维护。请使用全新的PanuonUI.Silver。\n```diff\n- 由于PanuonUI在设计初期的根本缺陷,PanuonUI从今日起已停止维护。\n- 请使用全新的"
}
]
// ... and 34 more files (download for full content)
About this extraction
This page contains the full source code of the Ruris/PanuonUI GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 234 files (3.2 MB), approximately 851.4k tokens, and a symbol index with 915 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.