Files
DP44/Common/DTS.CommonCore/Base/View/BaseWindow.cs
2026-04-17 14:55:32 -04:00

42 lines
1.2 KiB
C#

using System.Windows;
// ReSharper disable once CheckNamespace
namespace DTS.Common.Base
{
public class BaseWindow : Window, IBaseWindow
{
/// <summary>
/// Gets a value indicating whether the bound object data data has been changed (View is dirty).
/// </summary>
public bool IsDirty
{
get
{
if (DataContext != null)
{
if (DataContext is IBaseWindowModel baseWindowModel)
return baseWindowModel.IsDirty;
}
return false;
}
}
/// <summary>
/// Gets a header info which uses by the TabControl to display the TabItem's header.
/// </summary>
public string HeaderInfo
{
get
{
if (DataContext != null)
{
if (DataContext is IHeaderInfoProvider<string> iHeaderInfoProvider)
return iHeaderInfoProvider.HeaderInfo;
}
return string.Empty;
}
}
}
}