small improvements to RadFlyoutBase & RadDialogBase

This commit is contained in:
Schedel Pascal
2024-06-13 08:07:15 +02:00
parent cd3b6b4ec3
commit ea63866481
3 changed files with 40 additions and 16 deletions

View File

@@ -1,4 +1,6 @@
using Telerik.WinControls.UI;
using Telerik.WinControls;
using Telerik.WinControls.Svg;
using Telerik.WinControls.UI;
using Telerik.WinControls.UI.SplashScreen;
namespace Pilz.UI.Telerik.Dialogs;
@@ -24,6 +26,9 @@ partial class RadFlyoutBase
private static readonly List<FlyoutClosedEventHandler> flyoutCloseHandlers = new();
private static object? tagToAssign = null;
private static string? titleToAssing = null;
private static RadSvgImage? iconToAssign = null;
public static Control? ParentContext { get; private set; } = null;
static RadFlyoutBase()
@@ -39,6 +44,12 @@ partial class RadFlyoutBase
if (tagToAssign != null)
dialogBase.Tag = tagToAssign;
if (titleToAssing != null)
dialogBase.Title = titleToAssing;
if (iconToAssign != null)
dialogBase.TitleIcon = iconToAssign;
var eventArgs = new FlyoutCreatedEventArgs(dialogBase);
if (dialogBase is ILoadContent iLoadContent)
@@ -74,12 +85,19 @@ partial class RadFlyoutBase
public static void Show<T>(Control controlToAssociate, object? tag = null)
{
Show(controlToAssociate, typeof(T), tag);
Show<T>(controlToAssociate, tag: tag);
}
public static void Show(Control controlToAssociate, Type flyoutContentType, object? tag = null)
public static void Show<T>(Control controlToAssociate, string? title, RadSvgImage? icon, object? tag = null)
{
Show(controlToAssociate, typeof(T), title, icon, tag: tag);
}
public static void Show(Control controlToAssociate, Type flyoutContentType, string? title, RadSvgImage? icon, object? tag = null)
{
tagToAssign = tag;
titleToAssing = title;
iconToAssign = icon;
ParentContext = controlToAssociate;
RadFlyoutManager.Show(controlToAssociate, flyoutContentType);
}