-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MahApps/develop
Updating....
- Loading branch information
Showing
11 changed files
with
216 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System.ComponentModel; | ||
using System.Windows; | ||
|
||
namespace MahApps.Metro.Controls | ||
{ | ||
public static class ValidationHelper | ||
{ | ||
/// <summary> | ||
/// Identifies the CloseOnMouseLeftButtonDown attached property. | ||
/// </summary> | ||
public static readonly DependencyProperty CloseOnMouseLeftButtonDownProperty | ||
= DependencyProperty.RegisterAttached("CloseOnMouseLeftButtonDown", | ||
typeof(bool), | ||
typeof(ValidationHelper), | ||
new PropertyMetadata(false)); | ||
|
||
/// <summary> | ||
/// Gets whether if the popup can be closed by left mouse button down. | ||
/// </summary> | ||
[Category(AppName.MahApps)] | ||
[AttachedPropertyBrowsableForType(typeof(UIElement))] | ||
public static bool GetCloseOnMouseLeftButtonDown(UIElement element) | ||
{ | ||
return (bool)element.GetValue(CloseOnMouseLeftButtonDownProperty); | ||
} | ||
|
||
/// <summary> | ||
/// Sets whether if the popup can be closed by left mouse button down. | ||
/// </summary> | ||
[Category(AppName.MahApps)] | ||
[AttachedPropertyBrowsableForType(typeof(UIElement))] | ||
public static void SetCloseOnMouseLeftButtonDown(UIElement element, bool value) | ||
{ | ||
element.SetValue(CloseOnMouseLeftButtonDownProperty, value); | ||
} | ||
|
||
/// <summary> | ||
/// Identifies the ShowValidationErrorOnMouseOver attached property. | ||
/// </summary> | ||
public static readonly DependencyProperty ShowValidationErrorOnMouseOverProperty | ||
= DependencyProperty.RegisterAttached("ShowValidationErrorOnMouseOver", | ||
typeof(bool), | ||
typeof(ValidationHelper), | ||
new PropertyMetadata(false)); | ||
|
||
/// <summary> | ||
/// Gets whether the validation error text will be shown when hovering the validation triangle. | ||
/// </summary> | ||
[Category(AppName.MahApps)] | ||
[AttachedPropertyBrowsableForType(typeof(UIElement))] | ||
public static bool GetShowValidationErrorOnMouseOver(UIElement element) | ||
{ | ||
return (bool)element.GetValue(ShowValidationErrorOnMouseOverProperty); | ||
} | ||
|
||
/// <summary> | ||
/// Sets whether the validation error text will be shown when hovering the validation triangle. | ||
/// </summary> | ||
[Category(AppName.MahApps)] | ||
[AttachedPropertyBrowsableForType(typeof(UIElement))] | ||
public static void SetShowValidationErrorOnMouseOver(UIElement element, bool value) | ||
{ | ||
element.SetValue(ShowValidationErrorOnMouseOverProperty, value); | ||
} | ||
} | ||
} |
Oops, something went wrong.