整理控件库

This commit is contained in:
GG Z
2025-05-05 17:04:06 +08:00
parent 74532b77be
commit 3eaad7566e
283 changed files with 2156 additions and 17846 deletions

View File

@@ -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)