mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2024-09-19 12:18:48 -04:00
18 lines
516 B
C#
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;
|
|
}
|
|
}
|