Skip to content

Releases: SuGar0218/WindowedContentDialog

2.1.1

08 Oct 12:59

Choose a tag to compare

  • Fix MessageBox button text localization
  • Add KeyboardAccelerators for MessageBox and ContentDialog buttons
MessageBox_2.1.1

2.1.0

07 Oct 12:17

Choose a tag to compare

Use Windows API LoadString to load localized message box button text from user32.dll

2.0.1

01 Oct 13:17

Choose a tag to compare

WebView2 dll missing issue fixed by pull request #7

2.0.0

31 Aug 05:09

Choose a tag to compare

  • Remove custom owner window overlay.
  • Remove events like ContentDialogWindowButtonClicked, use System.ComponentModel.CancelEventArgs instead.
  • WindowedContentDialog, FlyoutContentDialog, ContentDialogWindow, ContentDialogFlyout and ContentDialogContent are available in XAML (issue #5).

Here are some examples:

Using WindowedContentDialog in <Page.Resources>:

<Page.Resources>
      <dialogs:WindowedContentDialog
          x:Key="XamlWindowedContentDialog"
          x:Name="XamlWindowedContentDialog"
          CloseButtonText="{x:Bind settings.CloseButtonText, Mode=OneWay}"
          DefaultButton="{x:Bind settings.DefaultButton, Mode=OneWay}"
          IsModal="{x:Bind settings.IsModal, Mode=OneWay}"
          IsPrimaryButtonEnabled="{x:Bind settings.IsPrimaryButtonEnabled, Mode=OneWay}"
          IsSecondaryButtonEnabled="{x:Bind settings.IsSecondaryButtonEnabled, Mode=OneWay}"
          OwnerWindow="{x:Bind app:App.Current.MainWindow}"
          PrimaryButtonText="{x:Bind settings.PrimaryButtonText, Mode=OneWay}"
          SecondaryButtonText="{x:Bind settings.SecondaryButtonText, Mode=OneWay}"
          SmokeBehind="{x:Bind settings.SmokeBehind, Mode=OneWay}">

          <dialogs:WindowedContentDialog.SystemBackdrop>
              <MicaBackdrop />
          </dialogs:WindowedContentDialog.SystemBackdrop>

          <dialogs:WindowedContentDialog.Title>
              <dialogs:MessageBoxHeader Icon="Information" Text="{x:Bind settings.Title, Mode=OneWay}" />
          </dialogs:WindowedContentDialog.Title>

          <StackPanel>
              <CheckBox Content="Lorem" IsThreeState="True" />
              <CheckBox Content="Ipsum" IsThreeState="True" />
              <CheckBox Content="Dolor" IsThreeState="True" />
              <CheckBox Content="Sit" IsThreeState="True" />
              <CheckBox Content="Amet" IsThreeState="True" />
          </StackPanel>
      </dialogs:WindowedContentDialog>
</Page.Resources>

Using FlyoutContentDialog in <Page.Resources>:

<Page.Resources>
    <dialogs:FlyoutContentDialog
        x:Key="XamlFlyoutContentDialog"
        x:Name="XamlFlyoutContentDialog"
        CloseButtonText="{x:Bind settings.CloseButtonText, Mode=OneWay}"
        IsPrimaryButtonEnabled="{x:Bind settings.IsPrimaryButtonEnabled, Mode=OneWay}"
        IsSecondaryButtonEnabled="{x:Bind settings.IsSecondaryButtonEnabled, Mode=OneWay}"
        PlacementTarget="{x:Bind ShowContentDialogButton}"
        PrimaryButtonText="{x:Bind settings.PrimaryButtonText, Mode=OneWay}"
        SecondaryButtonText="{x:Bind settings.SecondaryButtonText, Mode=OneWay}"
        SmokeBehind="{x:Bind settings.SmokeBehind, Mode=OneWay}">

        <dialogs:FlyoutContentDialog.Title>
            <dialogs:MessageBoxHeader Icon="Information" Text="{x:Bind settings.Title, Mode=OneWay}" />
        </dialogs:FlyoutContentDialog.Title>

        <StackPanel>
            <CheckBox Content="Lorem" IsThreeState="True" />
            <CheckBox Content="Ipsum" IsThreeState="True" />
            <CheckBox Content="Dolor" IsThreeState="True" />
            <CheckBox Content="Sit" IsThreeState="True" />
            <CheckBox Content="Amet" IsThreeState="True" />
        </StackPanel>
    </dialogs:FlyoutContentDialog>
</Page.Resources>

Using ContentDialogWindow in XAML:

<dialogs:ContentDialogWindow
    x:Class="SuGarToolkit.Sample.Dialogs.Views.SampleContentDialogWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:dialogs="using:SuGarToolkit.Controls.Dialogs"
    xmlns:local="using:SuGarToolkit.Sample.Dialogs.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="Sample ContentDialogWindow"
    CloseButtonText="Close Button"
    DefaultButton="Primary"
    DialogTitle="{x:Bind Title}"
    PrimaryButtonText="Primary Button"
    SecondaryButtonText="Secondary Button"
    mc:Ignorable="d">

    <dialogs:ContentDialogWindow.SystemBackdrop>
        <MicaBackdrop />
    </dialogs:ContentDialogWindow.SystemBackdrop>

    <StackPanel>
        <CheckBox Content="Using" IsThreeState="True" />
        <CheckBox Content="ContentDialogWindow" IsChecked="True" />
        <CheckBox Content="in XAML" IsThreeState="True" />
        <TextBox
            AcceptsReturn="True"
            FontFamily="Consolas"
            IsReadOnly="True"
            ScrollViewer.HorizontalScrollBarVisibility="Auto"
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            Text="{x:Bind local:SampleContentDialogWindow.XamlCode}" />
    </StackPanel>

</dialogs:ContentDialogWindow>

Using ContentDialogFlyout as Button.Flyout:

<Button
    HorizontalAlignment="Center"
    VerticalAlignment="Center"
    Content="ContentDialogFlyout"
    Style="{ThemeResource AccentButtonStyle}">
    <Button.Flyout>
        <dialogs:ContentDialogFlyout
            CloseButtonText="Close Button"
            DefaultButton="Primary"
            DialogTitle="Sample ContentDialogFlyout"
            PrimaryButtonText="Primary Button"
            RequestedTheme="{x:Bind ActualTheme}"
            SecondaryButtonText="Secondary Button">
            <StackPanel>
                <CheckBox Content="Using" IsThreeState="True" />
                <CheckBox Content="ContentDialogFlyout" IsChecked="True" />
                <CheckBox Content="in XAML" IsThreeState="True" />
                <TextBox
                    AcceptsReturn="True"
                    FontFamily="Consolas"
                    IsReadOnly="True"
                    ScrollViewer.HorizontalScrollBarVisibility="Auto"
                    ScrollViewer.VerticalScrollBarVisibility="Auto"
                    Text="{x:Bind local:ContentDialogFlyoutSamplePage.XamlCode}" />
            </StackPanel>
        </dialogs:ContentDialogFlyout>
    </Button.Flyout>
</Button>

1.2.1

22 Aug 11:53

Choose a tag to compare

  • Fix bug that SystemBackdrop of flyout with ShouldConstrainToRootBounds is false does not follow RequestedTheme — at least work properly currently (WindowsAppSDK 1.7).

1.2.0

22 Aug 07:20

Choose a tag to compare

  • Add flyouts: ContentDialogFlyout and FlyoutContentDialog, MessageBoxFlyout and FlyoutMessageBox.
  • New sample app.
  • DisableBehind=true is not suggested because it may cause exception, for example, a button with Style="{ThemeResource TitleBarPaneToggleButtonStyle}". (microsoft/microsoft-ui-xaml#10739)
  • ShouldConstraintToRootBounds=false is not suggested because SystemBackdrop of flyout with it cannot follow RequestedTheme.
FlyoutMessageBox FlyoutContentDialog

1.1.1

19 Aug 16:25

Choose a tag to compare

  • Add Chinese button text for MessageBox. (Supported: Chinese, English)
  • Change WindowedContentDialog width determining logic.
  • Remove default value for properties of MessageBoxOptions and add the property Default to get default options.
图片1

1.1.0

17 Aug 15:56

Choose a tag to compare

  • Make text message in MessageBox selectable, allowing user to copy.
  • Add MessageBox icon determined by MessageBoxImage similar to WPF.
  • Change MessageBox.ShowAsync and MessageBoxOptions to make it more similar to WPF.
  • Make InWindowMessageBox more similar to MessageBox.
WindowedContentDialog_1 1 0

1.0.7

16 Aug 12:23
d502420

Choose a tag to compare

  • Fix wrong height when title is more than 1 line.
  • Fix unexpected line break in content (possibly caused by slight lack of width).

1.0.6

15 Aug 06:59

Choose a tag to compare

  • Fix the size of dark smoke not following the window.
  • Add SmokeLayerKind.Custom option to ExamplePage.
  • Static properties have been moved to MessageBoxOptions (pull request #3), which can be passed to ShowAsync method to determine the action of MessageBox.
  • UI elements that are used as CustomSmokeLayer will be removed from visual tree after dialog is closed to avoid crash when smoke layer shows again.