Files
DP44/Common/DTS.CommonCore/.svn/pristine/49/496860a0d5b29d4025120b70b9f21624d00d5246.svn-base

49 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using System.Windows.Controls;
// ReSharper disable once CheckNamespace
namespace DTS.Common.Base
{
/// <summary>
/// Represents the base class for views that define the appearance of data in a UserControl control.
/// </summary>
///
public class BaseView : UserControl, IBaseView
{
/// <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 IBaseViewModel baseViewModel)
{
return baseViewModel.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> headerInfoProvider)
{
return headerInfoProvider.HeaderInfo;
}
}
return string.Empty;
}
}
}
}