forked from Federerer/Notifications.Wpf
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,067 additions
and
242 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace Notification.Wpf.Classes | ||
{ | ||
/// <summary> Are absolute position </summary> | ||
public class AbsolutePosition | ||
{ | ||
/// <summary> X position </summary> | ||
public double X { get; set; } | ||
/// <summary> Y position </summary> | ||
public double Y { get; set; } | ||
|
||
/// <summary> Base corner </summary> | ||
public Corner BaseCorner { get; set; } | ||
|
||
/// <summary> position </summary> | ||
public Thickness Margin => BaseCorner switch | ||
{ | ||
Corner.TopLeft => new Thickness(X, Y, 0, 0), | ||
Corner.TopRight => new Thickness(0, Y, X, 0), | ||
Corner.BottomLeft => new Thickness(X, 0, 0, Y), | ||
Corner.BottomRight => new Thickness(0, 0, X, Y), | ||
_ => throw new ArgumentOutOfRangeException() | ||
}; | ||
/// <summary> Horizontal Alignment </summary> | ||
public HorizontalAlignment HorAlign => BaseCorner switch | ||
{ | ||
Corner.TopLeft => HorizontalAlignment.Left, | ||
Corner.TopRight => HorizontalAlignment.Right, | ||
Corner.BottomLeft => HorizontalAlignment.Left, | ||
Corner.BottomRight => HorizontalAlignment.Right, | ||
_ => throw new ArgumentOutOfRangeException() | ||
}; | ||
/// <summary> Horizontal Alignment </summary> | ||
public VerticalAlignment VertAlign => BaseCorner switch | ||
{ | ||
Corner.TopLeft => VerticalAlignment.Top, | ||
Corner.TopRight => VerticalAlignment.Top, | ||
Corner.BottomLeft => VerticalAlignment.Bottom, | ||
Corner.BottomRight => VerticalAlignment.Bottom, | ||
_ => throw new ArgumentOutOfRangeException() | ||
}; | ||
|
||
} | ||
} |
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,10 @@ | ||
namespace Notification.Wpf; | ||
|
||
/// <summary> corners in window </summary> | ||
public enum Corner | ||
{ | ||
TopLeft, | ||
TopRight, | ||
BottomLeft, | ||
BottomRight | ||
} |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ public enum NotificationPosition | |
BottomCenter, | ||
CenterLeft, | ||
CenterRight, | ||
Center | ||
Center, | ||
Absolute | ||
} | ||
} |
Oops, something went wrong.