Merge pull request #307 from dotnet9/main
add other dialog services demo;
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
Title="Ursa.PrismDialogDemo">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Button Click="DialogButton_OnClick">Show Dialog</Button>
|
||||
<Button Click="OverlayDialogButton_OnClick">Show Overlay Dialog</Button>
|
||||
<Button Click="AloneDialogButton_OnClick">Show Alone Dialog</Button>
|
||||
<Button Click="DrawerButton_OnClick">Show Drawer</Button>
|
||||
</StackPanel>
|
||||
<u:OverlayDialogHost/>
|
||||
|
||||
@@ -1,28 +1,48 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using DryIoc;
|
||||
using Ursa.Controls;
|
||||
using Ursa.Controls.Options;
|
||||
using Ursa.PrismExtension;
|
||||
|
||||
namespace Ursa.PrismDialogDemo;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private IUrsaOverlayDialogService _dialogService;
|
||||
private IUrsaDrawerService _drawerService;
|
||||
public MainWindow(IUrsaOverlayDialogService dialogService, IUrsaDrawerService drawerService)
|
||||
private readonly IUrsaOverlayDialogService _overlayDialogService;
|
||||
private readonly IUrsaDialogService _aloneDialogService;
|
||||
private readonly IUrsaDrawerService _drawerService;
|
||||
|
||||
public MainWindow(IUrsaOverlayDialogService overlayDialogService, IUrsaDialogService aloneDialogService,
|
||||
IUrsaDrawerService drawerService)
|
||||
{
|
||||
InitializeComponent();
|
||||
_dialogService = dialogService;
|
||||
_overlayDialogService = overlayDialogService;
|
||||
_aloneDialogService = aloneDialogService;
|
||||
_drawerService = drawerService;
|
||||
}
|
||||
|
||||
private void DialogButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
private void OverlayDialogButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
_dialogService.ShowModal("Default", null, null, null);
|
||||
_overlayDialogService.ShowModal("Default", null, null, new OverlayDialogOptions()
|
||||
{
|
||||
Title = "This is dialog title"
|
||||
});
|
||||
}
|
||||
|
||||
private void AloneDialogButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
_aloneDialogService.ShowModal("Default", null, null, new DialogOptions()
|
||||
{
|
||||
Title = "This is dialog title"
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawerButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
_drawerService.ShowModal("Default", null, null, null);
|
||||
_drawerService.ShowModal("Default", null, null, new DrawerOptions()
|
||||
{
|
||||
Title = "This is dialog title"
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user