共用方式為


Windows 應用程式 SDK 1.4 的預覽通道版本資訊

重要

預覽通道已經不支援使用在生產環境,且使用預覽版本的應用程式無法發布到 Microsoft Store。

預覽通道包含 Windows 應用程式 SDK 版本,其中包括處於開發後期階段的預覽通道功能。 預覽版本不包含實驗性功能和 API,但在下一個穩定版本之前仍可能會發生重大變更。

重要連結

最新預覽通道版本:

最新穩定通道版本:

1.4 版 Preview 2 (1.4.0-preview2)

這是預覽通道為 1.4 版發布的最新版本。

在現有的 Windows 應用程式 SDK 1.3 版 (來自穩定通道) 應用程式中,您可以將 Nuget 套件更新為 1.4.0-preview2 (請參閱在 Visual Studio 使用 NuGet 套件管理員安裝與管理套件中的更新套件一節)。

如需更新的執行階段和 MSIX,請參閱 最新的 Windows 應用程式 SDK 下載

XAML Islands 不再是實驗版本

XAML Islands 和基礎的 ContentIslands 平台已不再是實驗版本。

  • 目前 XAML Islands 僅接受過在 C++ 應用程式使用的測試。 此版本不包含任何便利的包裝函式元素供 WPF 或 WinForms 使用。
  • DesktopWindowXamlSource與相關類型已新增到 XAML Islands 的 Microsoft.UI.Xaml.Hosting 命名空間。 XamlRoot.ContentIslandEnvironment已新增,有助於存取元素的基礎 Island 資訊。
  • 許多新類型的 Microsoft.UI.Content 命名空間和 Microsoft.UI.Input 命名空間已推出,可當作 XAML Islands 的基礎支援,或可在沒有 XAML 時使用此 ContentIslands 功能。
  • 新的 DragDropManager (加上相關類型) 已新增到 Microsoft.UI.Input.DragDrop 命名空間供 Island 情境使用。

ItemsView 更新

1.4-preview1 板新推出的 ItemsView 類別已大幅更新,加上新的屬性和支援類別。

  • 新的 ItemsView 控制項會顯示資料集合。 ItemsView 類似於 ListViewGridView 控制項,但在組建時使用的是 ItemsRepeaterScrollViewItemContainerItemCollectionTransitionProvider 元件。 它提供的獨特功能可用於插入自訂 LayoutItemCollectionTransitionProvider 實作。 其他關鍵優勢還有即時切換版面配置,同時保留項目選擇的功能。 內部的 ScrollView 控制項還具備 ListView/GridViewScrollViewer 控制項不提供的功能,例如在程式設計的捲動中控制動畫。
    • ItemsRepeater 新的 ItemTransitionProvider 屬性 (和新的 ItemsView 控制項) 可讓您針對該控制項,指定讓 ItemCollectionTransitionProvider 物件控制轉場動畫。 CreateDefaultItemTransitionProvider 方法已新增到 Layout,可讓版面配置物件提供隨附的遞補轉換,以備您沒有針對 ItemsView 控制項提供明確設定時之需。
    • 使用 Layout 新的 IndexBasedLayoutOrientation 屬性時,如有設定項目的版面配置方向,該方向會以項目在來源集合中的索引為依據。 預設值是 IndexBasedLayoutOrientation.None。 自訂版面配置是以呼叫新的 (受保護的) SetIndexBasedLayoutOrientation 方法來設定此屬性。
    • VirtualizingLayoutContext 新的 VisibleRect 屬性會在與 Layout 有關聯的 FrameworkElement 中取得可見的檢視區矩形。 受保護的虛擬 VirtualizingLayoutContext.VisibleRectCore 方法可以覆寫,藉此提供會從 VisibleRect 屬性傳回的值。
  • 新的 LinedFlowLayout 類別通常用於配置 ItemsView 集合控制項的項目。 它在顯示一系列相片時特別實用。 它會將相片由左至右與由上至下排列,每行都是八張。 相片會在填滿水平線後換到下一行。 為了與行貼合,相片的左右邊緣可能會經過裁切。 相片也可能會在部署延展模式時水平延伸,並在上下邊緣經過裁切,藉此將行填滿。

WinAppSDK 的新功能和更新

  • Popup/FlyoutBase.IsConstrainedToRootBounds = false已受支援,可讓快顯視窗/飛出視窗延伸到父視窗的邊界之外。 這些類型已新增 SystemBackdrop 屬性,藉此支援在這類不受限的快顯視窗使用壓克力。 功能表會按照預設,使用此屬性來加上壓克力。
  • ClosedFrameworkClosedIsClosed 已新增到 DesktopAcrylicControllerMicaController,藉此改善物件/執行緒關閉時的處理方式。
  • DesktopAcrylicController.Kind現在已可設為可在幾種標準壓克力外觀中做選擇。
  • DispatcherQueue有幾種新的事件和協助程式可加強讓關閉更井然有序,且可讓使用 Islands 的應用程式輕鬆執行標準的受支援事件迴圈。
  • InputNonClientPointerSource在 Microsoft.UI.Input 命名空間中可用於自訂標題列情境,藉此定義非用戶端區域的地區。 程式碼可註冊對應事件,例如在這些地區的懸停和點擊事件。
  • AppWindow 有幾種新的協助程式可取得 DispatcherQueue 並與之建立關聯。
  • 新的 TreeView.SelectionChanged 事件可讓開發人員在使用者或程式碼後置變更了 TreeView 控制項的所選節點組合時作出回應。
  • 新的 ScrollView 控制項提供 ScrollViewer 的新替代方案。 這個新的控制項在行為和 API 方面與現有的 ScrollViewer 控制項高度重疊,但卻是以 InteractionTracker 為基礎,具備動畫驅動的檢視變更等功能,且也是為了確保 ItemsRepeater 的完整功能而設計。 請參閱更有彈性的 ScrollViewer · 問題編號 108 · microsoft/microsoft-ui-xaml (github.com) 了解詳情。 完整的 ScrollView 模型已加入各種新類型,包括 ScrollPresenter
  • 新的 AnnotatedScrollBar 控制項擴充了一般的捲動桿功能,提供可輕鬆瀏覽大量項目集合的方法。 藉由可點擊的滑軌,加上可當作標記使用的標籤,上述方法得以實現。 它也會在懸停於可點擊的滑軌上方時顯示工具提示,藉此讓使用者更了解可捲動內容的細部。

1.4.0-Preview2 的新 API

1.4-preview2 版與之前的 1.4-preview1 版本相比,多了以下新 API:

Microsoft.UI
 
    ClosableNotifierHandler
    IClosableNotifier
Microsoft.UI.Composition.SystemBackdrops
 
    DesktopAcrylicController
        Closed
        FrameworkClosed
        IsClosed
        Kind
 
    DesktopAcrylicKind
    MicaController
        Closed
        FrameworkClosed
        IsClosed
Microsoft.UI.Content
 
    ContentCoordinateConverter
    ContentCoordinateRoundingMode
    ContentDeferral
    ContentEnvironmentSettingChangedEventArgs
    ContentEnvironmentStateChangedEventArgs
    ContentIsland
    ContentIslandAutomationProviderRequestedEventArgs
    ContentIslandEnvironment
    ContentIslandStateChangedEventArgs
    ContentLayoutDirection
    ContentSite
    ContentSiteEnvironment
    ContentSiteEnvironmentView
    ContentSiteRequestedStateChangedEventArgs
    ContentSiteView
    ContentSizePolicy
    DesktopChildSiteBridge
    DesktopSiteBridge
    IContentSiteBridge
Microsoft.UI.Dispatching
 
    DispatcherExitDeferral
    DispatcherQueue
        EnqueueEventLoopExit
        EnsureSystemDispatcherQueue
        FrameworkShutdownCompleted
        FrameworkShutdownStarting
        RunEventLoop
        RunEventLoop
 
    DispatcherQueueController
        ShutdownQueue
 
    DispatcherRunOptions
Microsoft.UI.Input
 
    CharacterReceivedEventArgs
    ContextMenuKeyEventArgs
    FocusChangedEventArgs
    InputActivationListener
        GetForIsland
 
    InputFocusChangedEventArgs
    InputFocusController
    InputKeyboardSource
        CharacterReceived
        ContextMenuKey
        GetCurrentKeyState
        GetForIsland
        GetKeyState
        KeyDown
        KeyUp
        SystemKeyDown
        SystemKeyUp
 
    InputNonClientPointerSource
    InputPointerSource
        GetForIsland
 
    InputPreTranslateKeyboardSource
    KeyEventArgs
    NonClientCaptionTappedEventArgs
    NonClientPointerEventArgs
    NonClientRegionKind
    NonClientRegionsChangedEventArgs
    PhysicalKeyStatus
    VirtualKeyStates
Microsoft.UI.Input.DragDrop
 
    DragDropManager
    DragDropModifiers
    DragInfo
    DragOperation
    DragUIContentMode
    DragUIOverride
    DropOperationTargetRequestedEventArgs
    IDropOperationTarget
Microsoft.UI.Windowing
 
    AppWindow
        AssociateWithDispatcherQueue
        Create
        DispatcherQueue
Microsoft.UI.Xaml
 
    XamlRoot
        ContentIslandEnvironment
Microsoft.UI.Xaml.Automation.Peers
 
    ItemsViewAutomationPeer
Microsoft.UI.Xaml.Controls
 
    AnnotatedScrollBar
    AnnotatedScrollBarDetailLabelRequestedEventArgs
    AnnotatedScrollBarLabel
    AnnotatedScrollBarScrollingEventArgs
    AnnotatedScrollBarScrollingEventKind
    IndexBasedLayoutOrientation
    ItemCollectionTransition
    ItemCollectionTransitionCompletedEventArgs
    ItemCollectionTransitionOperation
    ItemCollectionTransitionProgress
    ItemCollectionTransitionProvider
    ItemCollectionTransitionTriggers
    ItemsRepeater
        ItemTransitionProvider
        ItemTransitionProviderProperty
 
    ItemsView
    ItemsViewItemInvokedEventArgs
    ItemsViewSelectionChangedEventArgs
    ItemsViewSelectionMode
    Layout
        CreateDefaultItemTransitionProvider
        IndexBasedLayoutOrientation
        SetIndexBasedLayoutOrientation
 
    LinedFlowLayout
    LinedFlowLayoutItemCollectionTransitionProvider
    LinedFlowLayoutItemsInfoRequestedEventArgs
    LinedFlowLayoutItemsJustification
    LinedFlowLayoutItemsStretch
    ScrollingAnchorRequestedEventArgs
    ScrollingAnimationMode
    ScrollingBringingIntoViewEventArgs
    ScrollingChainMode
    ScrollingContentOrientation
    ScrollingInputKinds
    ScrollingInteractionState
    ScrollingRailMode
    ScrollingScrollAnimationStartingEventArgs
    ScrollingScrollBarVisibility
    ScrollingScrollCompletedEventArgs
    ScrollingScrollMode
    ScrollingScrollOptions
    ScrollingSnapPointsMode
    ScrollingZoomAnimationStartingEventArgs
    ScrollingZoomCompletedEventArgs
    ScrollingZoomMode
    ScrollingZoomOptions
    ScrollView
    TreeView
        SelectionChanged
 
    TreeViewSelectionChangedEventArgs
    VirtualizingLayoutContext
        VisibleRect
        VisibleRectCore
Microsoft.UI.Xaml.Controls.Primitives
 
    FlyoutBase
        SystemBackdrop
        SystemBackdropProperty
 
    IScrollController
    IScrollControllerPanningInfo
    Popup
        SystemBackdrop
        SystemBackdropProperty
 
    RepeatedScrollSnapPoint
    RepeatedZoomSnapPoint
    ScrollControllerAddScrollVelocityRequestedEventArgs
    ScrollControllerPanRequestedEventArgs
    ScrollControllerScrollByRequestedEventArgs
    ScrollControllerScrollToRequestedEventArgs
    ScrollPresenter
    ScrollSnapPoint
    ScrollSnapPointBase
    ScrollSnapPointsAlignment
    SnapPointBase
    ZoomSnapPoint
    ZoomSnapPointBase
Microsoft.UI.Xaml.Hosting
 
    DesktopWindowXamlSource
    DesktopWindowXamlSourceGotFocusEventArgs
    DesktopWindowXamlSourceTakeFocusRequestedEventArgs
    WindowsXamlManager
    XamlSourceFocusNavigationReason
    XamlSourceFocusNavigationRequest
    XamlSourceFocusNavigationResult

1.4 版 Preview 1 (1.4.0-preview1)

這是預覽通道為 1.4 版發布的最新版本。

在現有的 Windows 應用程式 SDK 1.3 版 (來自穩定通道) 應用程式中,您可以將 Nuget 套件更新為 1.4.0-preview1 (請參閱在 Visual Studio 使用 NuGet 套件管理員安裝與管理套件中的更新套件一節)。

如需更新的執行階段和 MSIX,請參閱 最新的 Windows 應用程式 SDK 下載

小工具更新

新增三種新介面,可供小工具提供者實作:IWidgetProvider2IWidgetProviderAnalyticsIWidgetProviderErrorsIWidgetProvider2 可讓提供者回應使用者叫用的自訂動作,等同於第一方小工具可提供的功能。 提供者可使用 IWidgetProviderAnalyticsIWidgetProviderErrors 為小工具收集遙測資料;小工具的分析和失敗事件都會通知對應的小工具提供者。 WidgetCustomizationRequestedArgsWidgetAnalyticsInfoReportedArgsWidgetErrorInfoReportedArgs 類別會用於通知相關資訊,以便支援新功能。

WinAppSDK 提供的新功能

  • 新的 ThemeSettings 類別可讓 Win32 WinRT 應用程式偵測到系統的高對比設定發生變更,此功能類似 UWP 的 AccessibilitySettings 類別。 請參閱 GitHub 的 ThemeSettings API 規格了解詳情。
  • Popup/FlyoutBase.ShouldConstrainToRootBounds已受支援,可讓工具提示、功能表和其他快顯視窗延伸到主視窗的邊界之外。 Preview 1 尚未完全支援在快顯視窗/飛出視窗使用壓克力或其他 SystemBackdrops;下個 1.4 版本將會納入其他 API 和這項實作功能。
  • AccessKeyManager.EnterDisplayMode是針對既有根目錄目前的焦點元素顯示存取金鑰的新方法。 顯示叫用命令的按鍵提示時,存取金鑰會處於「顯示模式」,例如在小畫家按下 Alt 鍵可顯示各個按鍵對應的控制項。 這種方法可讓使用者以程式設計方式進入顯示模式。
  • Application.ResourceManagerRequested 透過一套機制來提供不同的 IResourceManager,以便在預設 ResourceManager 無法運作時解析資源 URI。 請參閱 GitHub 的 Application.ResourceManagerRequested API 規格了解詳情。
  • 我們即將推出名稱為 ItemsView 的新清單控制項,以及對應的實體 ItemContainer 類別。 ItemContainer 是一種輕量的容器,內建選取狀態和視覺,可輕易包覆所需內容,並搭配 ItemsView 使用於集合控制項情境。 ItemsView在 Preview 1 仍然標示為實驗版,但會納入下個 1.4 版本。
  • WebView2 SDK 版本已從 1661.34 更新為 1823.32

1.4.0-Preview1 的新 API

1.4-preview1 版與 Stable 1.3 版本相比,多了以下新 API:

Microsoft.UI.System
 
    ThemeSettings
Microsoft.UI.Xaml
 
    Application
        ResourceManagerRequested
 
    ResourceManagerRequestedEventArgs
Microsoft.UI.Xaml.Automation.Peers
 
    ItemContainerAutomationPeer
Microsoft.UI.Xaml.Controls
 
    ItemContainer
Microsoft.UI.Xaml.Controls.Primitives
 
    CommandBarFlyoutCommandBar
        SystemBackdrop
        SystemBackdropProperty
Microsoft.UI.Xaml.Input
 
    AccessKeyManager
        EnterDisplayMode
Microsoft.Web.WebView2.Core
 
    CoreWebView2
        LaunchingExternalUriScheme
        MemoryUsageTargetLevel
 
    CoreWebView2File
    CoreWebView2LaunchingExternalUriSchemeEventArgs
    CoreWebView2MemoryUsageTargetLevel
    CoreWebView2PermissionKind
        WindowManagement
 
    CoreWebView2Profile
        CookieManager
        IsGeneralAutofillEnabled
        IsPasswordAutosaveEnabled
 
    CoreWebView2Settings
        IsReputationCheckingRequired
 
    CoreWebView2WebMessageReceivedEventArgs
        AdditionalObjects
Microsoft.Windows.Widgets.Providers
 
    IWidgetProvider2
    IWidgetProviderAnalytics
    IWidgetProviderErrors
    WidgetAnalyticsInfoReportedArgs
    WidgetCustomizationRequestedArgs
    WidgetErrorInfoReportedArgs