Major upgrade
This commit is contained in:
111
Source/Program/GUI/View/ConfirmationWindow.xaml.cs
Normal file
111
Source/Program/GUI/View/ConfirmationWindow.xaml.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
// UNCLASSIFIED
|
||||
/*-------------------------------------------------------------------------
|
||||
RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
|
||||
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
|
||||
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
|
||||
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
|
||||
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
|
||||
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
|
||||
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
|
||||
COMPANY.
|
||||
|
||||
THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S.
|
||||
GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using NLog;
|
||||
|
||||
namespace ProgramLib.GUI.View
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfirmationWindow.xaml
|
||||
/// </summary>
|
||||
internal partial class ConfirmationWindow : Window
|
||||
{
|
||||
private ILogger _logger;
|
||||
public GUI.Util.StandardButtons ClickedButton { get; private set; }
|
||||
public string ConfirmationMessage
|
||||
{
|
||||
private get
|
||||
{
|
||||
return lblMessage.Content.ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
lblMessage.Content = value;
|
||||
}
|
||||
}
|
||||
public string OkButtonText
|
||||
{
|
||||
private get
|
||||
{
|
||||
return btnOK.Content.ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
btnOK.Content = value;
|
||||
}
|
||||
}
|
||||
public string CancelButtonText
|
||||
{
|
||||
private get
|
||||
{
|
||||
return btnCancel.Content.ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
btnCancel.Content = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ConfirmationWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico");
|
||||
this.Icon = BitmapFrame.Create(iconUri);
|
||||
|
||||
ClickedButton = Util.StandardButtons.NOT_SET;
|
||||
|
||||
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
|
||||
}
|
||||
|
||||
protected override void OnContentRendered(EventArgs e)
|
||||
{
|
||||
base.OnContentRendered(e);
|
||||
|
||||
// Content of window may be black in case of SizeToContent is set.
|
||||
// This eliminates the problem.
|
||||
// Do not use InvalidateVisual because it may implicitly break your markup.
|
||||
InvalidateMeasure();
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ClickedButton = Util.StandardButtons.OK_YES;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ClickedButton = Util.StandardButtons.CANCEL_NO;
|
||||
this.Hide();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user