forked from CosmicDreamsOfCode/FrostyToolsuite
-
Notifications
You must be signed in to change notification settings - Fork 3
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
4 changed files
with
92 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Frosty.Controls; | ||
using System.Windows; | ||
|
||
namespace Frosty.Core.Controls | ||
{ | ||
public class FrostyHandledExceptionBox : FrostyDockableWindow | ||
{ | ||
#region -- Properties -- | ||
|
||
#region -- WarningText -- | ||
public static readonly DependencyProperty WarningTextProperty = DependencyProperty.Register("WarningText", typeof(string), typeof(FrostyHandledExceptionBox), new PropertyMetadata("")); | ||
public string WarningText { | ||
get => (string)GetValue(WarningTextProperty); | ||
set => SetValue(WarningTextProperty, value); | ||
} | ||
#endregion | ||
|
||
#endregion | ||
|
||
public FrostyHandledExceptionBox() | ||
{ | ||
Title = "Warning"; | ||
Topmost = true; | ||
ShowInTaskbar = false; | ||
|
||
Height = 180; | ||
Width = 400; | ||
|
||
WindowStartupLocation = WindowStartupLocation.CenterOwner; | ||
Window mainWin = Application.Current.MainWindow; | ||
} | ||
|
||
public override void OnApplyTemplate() | ||
{ | ||
base.OnApplyTemplate(); | ||
} | ||
|
||
public static MessageBoxResult Show(string warning) | ||
{ | ||
FrostyHandledExceptionBox window = new FrostyHandledExceptionBox | ||
{ | ||
WarningText = warning | ||
}; | ||
|
||
return (window.ShowDialog() == true) ? MessageBoxResult.OK : MessageBoxResult.Cancel; | ||
} | ||
} | ||
} |
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