整理控件库
This commit is contained in:
@@ -15,18 +15,32 @@ namespace WPFluent;
|
||||
/// ContentDialog(){ Title = "The cake?", Content = "IS A LIE!", PrimaryButtonText = "Save", SecondaryButtonText =
|
||||
/// "Don't Save", CloseButtonText = "Cancel" } );</code>
|
||||
/// </example>
|
||||
public class ContentDialogService : IContentDialogService
|
||||
public class ContentDialogService
|
||||
{
|
||||
private ContentPresenter? _dialogHost;
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// 提供对 <see cref="ContentPresenter"/> 的直接访问。
|
||||
/// </summary>
|
||||
/// <returns>引用当前选定的 <see cref="ContentPresenter"/> 显示 <see cref="ContentDialog"/> 的内容。</returns>
|
||||
public ContentPresenter? GetDialogHost() { return _dialogHost; }
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ContentPresenter"/>
|
||||
/// </summary>
|
||||
/// <param name="dialogHost">
|
||||
/// <see cref="ContentPresenter"/> inside of which the dialogue will be placed. The new <see cref="ContentDialog"/> will
|
||||
/// replace the current <see cref="ContentPresenter.Content"/>.
|
||||
/// </param>
|
||||
public void SetDialogHost(ContentPresenter contentPresenter) { _dialogHost = contentPresenter; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Asynchronously shows the specified dialog.
|
||||
/// </summary>
|
||||
/// <param name="dialog">The dialog to be displayed.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains the dialog result.</returns>
|
||||
public Task<ContentDialogResult> ShowAsync(ContentDialog dialog, CancellationToken cancellationToken)
|
||||
{
|
||||
if (_dialogHost == null)
|
||||
|
||||
Reference in New Issue
Block a user