Pilz.UI.Telerik aktualisieren

2024-07-05 07:58:41 +00:00
parent 75adaaadc5
commit 815f13f911

@@ -49,10 +49,98 @@ private void RadButton_Cancel_Click(object sender, EventArgs e)
}
```
## Using flyouts
## Use the UI as flyout
## Using dialogs
Use the static `RadFlyoutBase.Show<>()` method for opening a flyout. This uses `RadFlyout` as base and will create a new instance of the provided type.
# SymbolFactory
```csharp
RadFlyoutBase.Show<MyFlyout>(this, strTitle, svgSymbol);
```
tba
### Events for prepair & result callback
There are some static events you can use to initialize a flyout or get back the some values.
```csharp
public AccountManagerPage()
{
RadFlyoutBase.FlyoutCreated += RadFlyoutBase_FlyoutCreated;
RadFlyoutBase.FlyoutClosed += RadFlyoutBase_FlyoutClosed;
}
private void RadFlyoutBase_FlyoutCreated(FlyoutCreatedEventArgs e)
{
if (e.Parent == this && e.Content is MyFlyout flyout && flyout.Result == DialogResult.OK)
{
// ...
}
}
private void RadFlyoutBase_FlyoutClosed(FlyoutClosedEventArgs e)
{
if (e.Parent == this && e.Content is MyFlyout flyout && flyout.Result == DialogResult.OK)
{
// ...
}
}
```
Ensure you unregister your handlers from the event on Dispose or deconstructor!
```csharp
~AccountManagerPage()
{
RadFlyoutBase.FlyoutCreated += RadFlyoutBase_FlyoutCreated;
RadFlyoutBase.FlyoutClosed += RadFlyoutBase_FlyoutClosed;
}
```
## Use the UI as dialog
Use the static `RadDialogBase.Show<>()` or `RadDialogBase.Show()` methods to open a dialog. This will use the provided istance or create a new one of the provided type.
```csharp
var flyout = RadDialogBase.Show<MyFlyout>(radListView_Accounts, strTitle, svgSymbol);
if (flyout.Result == DialogResult.OK)
{
// ...
}
```
### Events for prepair & result callback
There are some static events you can use to initialize a flyout or get back the some values.
```csharp
public AccountManagerPage()
{
RadDialogBase.DialogLoading += RadDialogBase_DialogLoading;
RadDialogBase.DialogClosed += RadDialogBase_DialogClosed;
}
private void RadDialogBase_DialogLoading(DialogLoadingEventArgs e)
{
if (RadFlyoutBase.ParentContext == this && e.Content is MyFlyout flyout)
{
// ...
}
}
private void RadDialogBase_DialogClosed(DialogClosedEventArgs e)
{
if (RadFlyoutBase.ParentContext == this && e.Content is MyFlyout flyout && flyout.Result == DialogResult.OK)
{
// ...
}
}
```
Ensure you unregister your handlers from the event on Dispose or deconstructor!
```csharp
~AccountManagerPage()
{
RadDialogBase.DialogLoading -= RadDialogBase_DialogLoading;
RadDialogBase.DialogClosed -= RadDialogBase_DialogClosed;
}
```