DiscordChatExporter/DiscordChatExporter.Gui/Framework/UserControl.cs
2024-04-27 04:17:46 +03:00

18 lines
516 B
C#

using System;
using Avalonia.Controls;
namespace DiscordChatExporter.Gui.Framework;
public class UserControl<TDataContext> : UserControl
{
public new TDataContext DataContext
{
get =>
base.DataContext is TDataContext dataContext
? dataContext
: throw new InvalidCastException(
$"DataContext is null or not of the expected type '{typeof(TDataContext).FullName}'."
);
set => base.DataContext = value;
}
}