ScrollViewer 類別

定義

代表可以包含其他可見元素的可捲動區域。

public ref class ScrollViewer sealed : ContentControl
public ref class ScrollViewer sealed : ContentControl, IScrollAnchorProvider
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ScrollViewer final : ContentControl
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ScrollViewer final : ContentControl
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ScrollViewer final : ContentControl, IScrollAnchorProvider
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ScrollViewer : ContentControl
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ScrollViewer : ContentControl
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ScrollViewer : ContentControl, IScrollAnchorProvider
Public NotInheritable Class ScrollViewer
Inherits ContentControl
Public NotInheritable Class ScrollViewer
Inherits ContentControl
Implements IScrollAnchorProvider
<ScrollViewer .../>
-or-
<ScrollViewer ...>
content
</ScrollViewer>
繼承
Object Platform::Object IInspectable DependencyObject UIElement FrameworkElement Control ContentControl ScrollViewer
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

提示

如需詳細資訊、設計指引和程式碼範例,請參閱 捲動檢視器

WinUI 2 資源庫應用程式包含大部分 WinUI 2 控制項、特性和功能的互動式範例。 從 Microsoft Store 取得應用程式,或在 GitHub上取得原始程式碼。

下列 XAML 會在 ScrollViewer 內建立大型 TextBlock ,以及另一個 TextBlock 複本進行比較。

<StackPanel>
    <!-- A large TextBlock. -->
    <TextBlock Width="300" TextWrapping="Wrap" Margin="0,0,0,30" 
      Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac mi ipsum. Phasellus vel malesuada mauris. Donec pharetra, enim sit amet mattis tincidunt, felis nisi semper lectus, vel porta diam nisi in augue. Pellentesque lacus tortor, aliquam et faucibus id, rhoncus ut justo. Sed id lectus odio, eget pulvinar diam. Suspendisse eleifend ornare libero, in luctus purus aliquet non. Sed interdum, sem vitae rutrum rhoncus, felis ligula ultrices sem, in eleifend eros ante id neque." />
    
    <!-- The same large TextBlock, wrapped in a ScrollViewer. -->
    <ScrollViewer Height="200" Width="200" 
                  HorizontalScrollBarVisibility="Auto" 
                  VerticalScrollBarVisibility="Auto">
        <TextBlock Width="300" TextWrapping="Wrap"
            Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac mi ipsum. Phasellus vel malesuada mauris. Donec pharetra, enim sit amet mattis tincidunt, felis nisi semper lectus, vel porta diam nisi in augue. Pellentesque lacus tortor, aliquam et faucibus id, rhoncus ut justo. Sed id lectus odio, eget pulvinar diam. Suspendisse eleifend ornare libero, in luctus purus aliquet non. Sed interdum, sem vitae rutrum rhoncus, felis ligula ultrices sem, in eleifend eros ante id neque." />
    </ScrollViewer>
</StackPanel>

備註

提示

如需詳細資訊、設計指引和程式碼範例,請參閱 捲動檢視器控制項

ScrollViewer 是一種容器控制項,可讓使用者移動流覽和縮放其內容。

捲動檢視器控制項

ScrollViewer 可讓內容顯示在小於其實際大小的區域中。 當 ScrollViewer 的內容完全看不到時,ScrollViewer 會顯示使用者可用來移動可見內容區域的捲軸。 包含 ScrollViewer 所有內容的區域是範圍。 內容的可見區域是 viewport。

對於 ScrollViewer 控制項而言,當做其他控制項的複合部分存在很獨特。 ScrollViewer 元件以及支援的 ScrollContentPresenter 類別只會在主控制項的配置空間限制小於展開的內容大小時,才會顯示檢視區以及捲軸。 這種情況通常發生在清單中,因此 ListViewGridView 範本一律包含 ScrollViewer。 TextBoxRichEditBox 也在其範本中包含一個 ScrollViewer。

當控制項中的 ScrollViewer 元件存在時,主控制項通常具有特定輸入事件和操作的內建事件處理,可讓內容捲動。 例如, GridView 會解譯撥動手勢,這會導致內容水準捲動。 主控制項所收到的輸入事件與原始操作都會被視為由控制項處理,因此將不會引發較低層級的事件 (例如 PointerPressed),也不會產生任何父容器。 您可以透過覆寫事件的控制項類別 OnEvent 虛擬方法,或透過重製控制項的範本,來變更部分內建的控制項處理。 但在任一種情況下,重現通常就在那裡的原始預設行為,讓控制項以預期的方式回應事件和使用者的輸入動作與手勢並不容易。 因此,您應該考慮您是否真的需要引發該輸入事件。 您可能想要調查是否有其他輸入事件或手勢未受到控制處理,並在您的應用程式或控制項互動設計中使用這些事件。

為了能夠讓包含 ScrollViewer 的控制項影響來自 ScrollViewer 組件內的部分行為和屬性,ScrollViewer 會定義一些可以在樣式中設定,並在範本繫結中使用的 XAML 附加屬性。

如果您需要在可捲動檢視中處理 UIElement 的指標事件, (例如 ScrollViewer) ,您必須呼叫 UIElement.CancelDirectmanipulation () ,明確停用檢視中專案的操作事件支援。 若要在檢視中重新啟用操作事件,請呼叫 UIElement.TryStartDirectManipulation()

手寫筆互動

從 Windows 10 1709 版 (SDK 16299) 開始,UWP app 中作用中手寫筆的預設行為就是捲動/移動流覽 (,就像觸控、觸控板和被動手寫筆) 一樣。 ScrollViewer 會取用指標事件,除非您指定您想要自行處理事件,而且不希望它們用於操作。

在 1709 之前的 Windows 10 版本中,預設行為是選取文字。

如果您的 app 應該使用作用中的手寫筆進行文字選取,您可以覆寫畫筆捲動並還原為先前的行為。 若要這樣做,請處理 PointerPressed 事件,並設定 ManipulationMode 屬性,以指定系統不應該處理手寫筆互動來捲動主 ScrollViewer。 您也可以處理 PointerReleasedPointerCanceled 事件,以在移除 Pen 時重新開啟預設系統行為。

此範例示範如何:

  • 使用 AddHandler 方法註冊事件,並將 handledEventsToo 參數設定為 true
  • 檢查指標裝置是否為 手寫筆
  • PointerPressed 事件處理常式中,關閉 ScrollViewer 中的系統操作支援。
  • PointerReleasedPointerCanceled 事件處理常式中,重新開啟系統操作支援。
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <ScrollViewer x:Name="myScrollViewer">
        <Image Source="Assets/StoreLogo.png"/>
    </ScrollViewer>
</Grid>
public MainPage()
{
    this.InitializeComponent();

    this.myScrollViewer.AddHandler(UIElement.PointerPressedEvent, 
        new PointerEventHandler(myScrollViewer_PointerPressed), 
        true /*handledEventsToo*/);
    this.myScrollViewer.AddHandler(UIElement.PointerReleasedEvent, 
        new PointerEventHandler(myScrollViewer_PointerReleased), 
        true /*handledEventsToo*/);
    this.myScrollViewer.AddHandler(UIElement.PointerCanceledEvent, 
        new PointerEventHandler(myScrollViewer_PointerCanceled), 
        true /*handledEventsToo*/);
}

private void myScrollViewer_PointerPressed(object sender, PointerRoutedEventArgs e)
{
    if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
    {
        (myScrollViewer.Content as UIElement).ManipulationMode &= ~ManipulationModes.System;
    }
}

private void myScrollViewer_PointerReleased(object sender, PointerRoutedEventArgs e)
{
    if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
    {
        (myScrollViewer.Content as UIElement).ManipulationMode |= ManipulationModes.System;
    }
}

private void myScrollViewer_PointerCanceled(object sender, PointerRoutedEventArgs e)
{
    if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
    {
        (myScrollViewer.Content as UIElement).ManipulationMode |= ManipulationModes.System;
    }
}

ScrollViewer XAML 附加屬性

ScrollViewer 會定義下列 XAML 附加屬性︰

這些 XAML 附加屬性適用于 ScrollViewer 是隱含的情況,例如當 ScrollViewer 存在於 ListViewGridView的預設範本中,而且您想要能夠影響控制項的捲動行為,而不需要存取範本元件。 如果您的 XAML 中明確顯示 ScrollViewer 的情況,如範例區段中的範例程式碼所示,您不需要使用附加屬性語法。 只要使用屬性語法,例如 <ScrollViewer ZoomMode="Enabled" />

為了支援 XAML 處理器存取附加屬性,以及公開對等的 get 和 set 作業給程式碼,每個 XAML 附加屬性都有一對 GetSet 存取子方法。 例如, GetHorizontalScrollModeSetHorizontalScrollMode 方法支援,並提供 ScrollViewer.HorizontalScrollMode的對等程式碼支援。 或者,您可以使用相依性屬性系統來取得或設定附加屬性的值。 呼叫 GetValueSetValue,傳遞要設定的相依性屬性識別碼引數,以及要取得或設定值的目標物件參考。

控制項樣式和範本

您可以修改預設 的 StyleControlTemplate ,讓控制項具有唯一的外觀。 如需修改控制項樣式和範本的相關資訊,請參閱 設定控制項的樣式。 定義控制面板的預設樣式、範本和資源會包含在 檔案中 generic.xaml 。 為了設計目的, generic.xaml 可在本機使用 SDK 或 NuGet 套件安裝。

  • WinUI 樣式 (建議) 如需來自 WinUI 的更新樣式,請參閱 \Users\<username>\.nuget\packages\microsoft.ui.xaml\<version>\lib\uap10.0\Microsoft.UI.Xaml\Themes\generic.xaml
  • 非 WinUI 樣式: 如需內建樣式,請參閱 %ProgramFiles(x86)%\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\<SDK version>\Generic\generic.xaml

如果您自訂安裝,位置可能會不同。 不同 SDK 版本的樣式和資源可能會有不同的值。

XAML 也包含可用來修改不同視覺狀態中控制項色彩的資源,而不需修改控制項範本。 建議您修改這些資源來設定 背景前景等屬性。 如需詳細資訊,請參閱XAML 樣式一文的輕量樣式一節。 從 Windows 10 1607 版 (SDK 14393) 開始,即可使用輕量型樣式資源。

Windows 8 行為

追蹤板裝置的手勢處理

針對Windows 8,ScrollViewer 控制群組件所處理輸入的追蹤板裝置手勢會解譯為滑鼠滾輪輸入,因此會引發PointerWheelChanged事件。 從Windows 8.1開始,ScrollViewer 會使用基礎操作邏輯,將追蹤板手勢解譯為 ScrollViewer 回應的動作,因此該手勢會被視為由控制項處理,而且PointerWheelChanged事件不再引發。

如果您將應用程式程式碼從 Windows 8 移轉至Windows 8.1您可能會想要考慮此行為變更,因為它會導致PointerWheelChanged在較少的情況下引發。 此外,現在內建 ScrollViewer 的行為可能會複製處理常式完成的工作。

針對 Windows 8 編譯但在 Windows 8.1 上執行的應用程式會繼續使用 Windows 8 的行為。

螢幕鍵盤的應用程式 UI

Windows 8內部實作的邏輯會在使用者叫用螢幕鍵盤時,將 ScrollViewer 與整體應用程式 UI 產生關聯。 此螢幕鍵盤是使用者透過輕鬆存取中心要求的特定協助工具功能。 如果系統未偵測到鍵盤裝置,它與可在文字輸入控制項的應用程式 UI 中顯示的軟式鍵盤不同。 內部 ScrollViewer 在這裡執行的動作是,如果捲動應用程式所在的區域,則會強制捲動它,因為鍵盤佔用 UI 空間。

從Windows 8.1開始,當螢幕鍵盤出現時,系統仍會有 UI/版面配置行為,但不再使用此內部建立的 ScrollViewer。 而是使用應用程式程式碼無法變更或檢查的專用內部控制項。

此行為變更的大部分層面完全不會影響應用程式。 不過,您的應用程式可能已預期此行為,方法是提供隱含 的 ScrollViewer 樣式 來變更版面配置,或使用 VisualTreeHelper 在樹狀結構中逐步尋找此內部建立的 ScrollViewer 並在執行時間加以改變。 針對針對Windows 8.1編譯的應用程式,該程式碼將無法使用。

針對 Windows 8 編譯但在 Windows 8.1 上執行的應用程式會繼續使用 Windows 8 的行為。

版本歷程記錄

Windows 版本 SDK 版本 已新增值
1809 17763 AnchorRequested
1809 17763 CanContentRenderOutsideBounds
1809 17763 CurrentAnchor
1809 17763 GetCanContentRenderOutsideBounds
1809 17763 HorizontalAnchorRatio
1809 17763 ReduceViewportForCoreInputViewOcclusions
1809 17763 RegisterAnchorCandidate
1809 17763 SetCanContentRenderOutsideBounds
1809 17763 UnregisterAnchorCandidate
1809 17763 VerticalAnchorRatio

建構函式

ScrollViewer()

初始化 ScrollViewer 類別的新實例。

屬性

AccessKey

取得或設定這個專案的便捷鍵 (助憶鍵) 。

(繼承來源 UIElement)
AccessKeyScopeOwner

取得或設定來源專案,這個元素會提供這個專案的存取索引鍵範圍,即使它不在來源專案的視覺化樹狀結構中也一樣。

(繼承來源 UIElement)
ActualHeight

取得 FrameworkElement的呈現高度。 請參閱<備註>。

(繼承來源 FrameworkElement)
ActualOffset

取得這個 UIElement 的位置,相對於其父系,在配置程式的排列階段期間計算。

(繼承來源 UIElement)
ActualSize

取得這個 UIElement 在配置程式的排列階段期間計算的大小。

(繼承來源 UIElement)
ActualTheme

取得專案目前使用的 UI 主題,可能與 RequestedTheme不同。

(繼承來源 FrameworkElement)
ActualWidth

取得 FrameworkElement的呈現寬度。 請參閱<備註>。

(繼承來源 FrameworkElement)
AllowDrop

取得或設定值,這個值會判斷這個 UIElement 是否可以是拖放作業的置放目標。

(繼承來源 UIElement)
AllowFocusOnInteraction

取得或設定值,這個值表示當使用者與其互動時,專案是否會自動取得焦點。

(繼承來源 FrameworkElement)
AllowFocusWhenDisabled

取得或設定停用的控制項是否可以接收焦點。

(繼承來源 FrameworkElement)
Background

取得或設定提供控制項背景的筆刷。

(繼承來源 Control)
BackgroundSizing

取得或設定值,這個值表示背景相對於這個專案框線的延伸距離。

(繼承來源 Control)
BaseUri

取得統一資源識別元 (URI) ,代表 XAML 載入時間 XAML 建構物件的基底統一資源識別元 (URI) 。 此屬性適用于執行時間的統一資源識別項 (URI) 解析。

(繼承來源 FrameworkElement)
BorderBrush

取得或設定描述控制項框線填滿的筆刷。

(繼承來源 Control)
BorderThickness

取得或設定控制項的框線粗細。

(繼承來源 Control)
BringIntoViewOnFocusChange

取得或設定值,這個值會決定當檢視中的專案取得焦點時 ,ScrollViewer 是否使用內嵌檢視捲動行為。

BringIntoViewOnFocusChangeProperty

識別 BringIntoViewOnFocusChange 相依性屬性。

CacheMode

取得或設定值,這個值表示轉譯的內容應該盡可能快取為複合點陣圖。

(繼承來源 UIElement)
CanBeScrollAnchor

取得或設定值,這個值表示 UIElement 是否可以是捲動錨定候選項目。

(繼承來源 UIElement)
CanContentRenderOutsideBounds

取得或設定值,這個值表示捲動的內容是否可以在 ScrollViewer 的界限之外轉譯。

CanContentRenderOutsideBoundsProperty

識別 CanContentRenderOutsideBounds 相依性屬性。

CanDrag

取得或設定值,這個值表示是否可以將專案拖曳為拖放作業中的資料。

(繼承來源 UIElement)
CenterPoint

取得或設定專案的中心點,這是發生旋轉或縮放的點。 影響專案的轉譯位置。

(繼承來源 UIElement)
CharacterSpacing

取得或設定字元之間的統一間距,單位為 em 的 1/1000。

(繼承來源 Control)
Clip

取得或設定用來定義UIElement內容的大綱的RectangleGeometry

(繼承來源 UIElement)
CompositeMode

取得或設定屬性,這個屬性會宣告其父版面配置和視窗中專案的替代組合和混合模式。 這與混合 XAML/Microsoft DirectX UI 相關的元素相關。

(繼承來源 UIElement)
ComputedHorizontalScrollBarVisibility

取得值,指出水準 ScrollBar 是否可見。

ComputedHorizontalScrollBarVisibilityProperty

識別 ComputedHorizontalScrollBarVisibility 相 依性屬性。

ComputedVerticalScrollBarVisibility

取得值,指出垂直 ScrollBar 是否可見。

ComputedVerticalScrollBarVisibilityProperty

識別 ComputedVerticalScrollBarVisibility 相依 性屬性。

Content

取得或設定 ContentControl的內容。

(繼承來源 ContentControl)
ContentTemplate

取得或設定用來顯示 ContentControl內容的資料範本。

(繼承來源 ContentControl)
ContentTemplateRoot

取得 ContentTemplate 屬性所指定之資料範本的根項目。

(繼承來源 ContentControl)
ContentTemplateSelector

取得或設定選取物件,根據執行時間的內容專案或其容器的處理資訊,變更 DataTemplate 以套用內容。

(繼承來源 ContentControl)
ContentTransitions

取得或設定套用至ContentControl內容的Transition樣式專案集合。

(繼承來源 ContentControl)
ContextFlyout

取得或設定與這個專案相關聯的飛出視窗。

(繼承來源 UIElement)
CornerRadius

取得或設定控制項框線角落的半徑。

(繼承來源 Control)
CurrentAnchor

目前選擇的錨點專案,用於捲動錨定。

DataContext

取得或設定 FrameworkElement的資料內容。 資料內容的常見用法是 當 FrameworkElement 使用 {Binding} 標記延伸並參與資料系結時。

(繼承來源 FrameworkElement)
DefaultStyleKey

取得或設定參考控制項預設樣式的索引鍵。 自訂控制項的作者會使用此屬性來變更其控制項所使用的樣式預設值。

(繼承來源 Control)
DefaultStyleResourceUri

取得或設定資源檔的路徑,其中包含控制項的預設樣式。

(繼承來源 Control)
DesiredSize

取得這個 UIElement 在版面配置程式的量值階段期間計算的大小。

(繼承來源 UIElement)
Dispatcher

取得與此物件相關聯的 CoreDispatcherCoreDispatcher代表可以存取 UI 執行緒上DependencyObject的功能,即使程式碼是由非 UI 執行緒起始也一樣。

(繼承來源 DependencyObject)
ElementSoundMode

取得或設定值,指定是否播放音效的控制項喜好設定。

(繼承來源 Control)
ExitDisplayModeOnAccessKeyInvoked

取得或設定值,指定叫用存取金鑰時是否關閉存取金鑰顯示。

(繼承來源 UIElement)
ExtentHeight

取得 ScrollViewer中所有可捲動內容的垂直大小。

ExtentHeightProperty

ExtentHeight相依性屬性的識別碼。

ExtentWidth

取得 ScrollViewer中所有可捲動內容的水準大小。

ExtentWidthProperty

ExtentWidth相依性屬性的識別碼。

FlowDirection

取得或設定文字和其他 UI 元素在控制其版面配置的任何父元素內流動的方向。 這個屬性可以設定為 LeftToRightRightToLeft。 在任何元素上將 FlowDirection 設定為 RightToLeft ,會將對齊方式設定為右側、從右至左的讀取順序,以及控制項從右至左流動的版面配置。

(繼承來源 FrameworkElement)
FocusState

取得值,指定這個控制項是否有焦點,以及取得焦點的模式。

(繼承來源 Control)
FocusVisualMargin

取得或設定 FrameworkElement焦點視覺效果的外部邊界。

(繼承來源 FrameworkElement)
FocusVisualPrimaryBrush

取得或設定筆刷,用來繪製FrameworkElement之或 Reveal 焦點視覺效果的外部 HighVisibility 框線。

(繼承來源 FrameworkElement)
FocusVisualPrimaryThickness

取得或設定FrameworkElement之外部 Reveal 框線的 HighVisibility 粗細。

(繼承來源 FrameworkElement)
FocusVisualSecondaryBrush

取得或設定筆刷,用來繪製FrameworkElement之或 Reveal 焦點視覺效果的內部 HighVisibility 框線。

(繼承來源 FrameworkElement)
FocusVisualSecondaryThickness

取得或設定FrameworkElementHighVisibilityReveal 焦點視覺效果的內部框線粗細。

(繼承來源 FrameworkElement)
FontFamily

取得或設定顯示控制項的文字所用的字型。

(繼承來源 Control)
FontSize

取得或設定這個控制項中的文字大小。

(繼承來源 Control)
FontStretch

取得或設定螢幕上字型緊縮或加寬的程度。

(繼承來源 Control)
FontStyle

取得或設定呈現文字的樣式。

(繼承來源 Control)
FontWeight

取得或設定指定字型的粗細。

(繼承來源 Control)
Foreground

取得或設定描述前景色彩的筆刷。

(繼承來源 Control)
Height

取得或設定 FrameworkElement的建議高度。

(繼承來源 FrameworkElement)
HighContrastAdjustment

取得或設定值,這個值表示當啟用高對比主題時,架構是否會自動調整專案的視覺屬性。

(繼承來源 UIElement)
HorizontalAlignment

取得或設定在版面配置父系中撰寫時套用至 FrameworkElement 的水準對齊特性,例如面板或專案控制項。

(繼承來源 FrameworkElement)
HorizontalAnchorRatio

決定 ScrollViewer 錨點 相對於檢視區的水準位置。 根據預設,ScrollViewer 會識別其檢視區最接近錨點的元素,以選取專案作為其 CurrentAnchor

HorizontalAnchorRatioProperty

識別 HorizontalAnchorRatio 相依性屬性。

HorizontalContentAlignment

取得或設定控制項內容的水平對齊。

(繼承來源 Control)
HorizontalOffset

取得內容水準捲動的距離。

HorizontalOffsetProperty

識別 HorizontalOffset 相依性屬性。

HorizontalScrollBarVisibility

取得或設定值,這個值表示是否應該顯示水準 ScrollBar

HorizontalScrollBarVisibilityProperty

識別 HorizontalScrollBarVisibility 相 依性屬性。

HorizontalScrollMode

取得或設定值,這個值會決定操作輸入如何影響水準軸上的捲動行為。

HorizontalScrollModeProperty

識別 HorizontalScrollMode 相依性屬性。

HorizontalSnapPointsAlignment

取得或設定值,這個值表示現有貼齊點與初始檢視區的水準對齊方式。

HorizontalSnapPointsAlignmentProperty

識別 HorizontalSnapPointsAlignment 相依性屬性。

HorizontalSnapPointsType

取得或設定值,這個值會宣告操作行為如何回應水準軸上的貼齊點。

HorizontalSnapPointsTypeProperty

識別 HorizontalSnapPointsType 相依性屬性。

IsAccessKeyScope

取得或設定值,這個值表示專案是否定義自己的存取金鑰範圍。

(繼承來源 UIElement)
IsDeferredScrollingEnabled

取得或設定值,這個值會決定 ScrollViewer的延後捲動行為。

IsDeferredScrollingEnabledProperty

識別 IsDeferredScrollingEnabled 相依性屬性。

IsDoubleTapEnabled

取得或設定值,這個值會判斷 DoubleTapped 事件是否可以來自該專案。

(繼承來源 UIElement)
IsEnabled

取得或設定值,指出使用者是否可以與控制項互動。

(繼承來源 Control)
IsFocusEngaged

取得或設定值,這個值表示焦點是否受限於遊戲台/遠端互動 (控制項界限) 。

(繼承來源 Control)
IsFocusEngagementEnabled

取得或設定值,指出焦點是否可以限制在控制界限內, (遊戲台/遠端互動) 。

(繼承來源 Control)
IsHitTestVisible

取得或設定這個 UIElement 的自主區域是否可以傳回真正的值來進行點擊測試。

(繼承來源 UIElement)
IsHoldingEnabled

取得或設定值,這個值會決定 Holding 事件是否可以來自該專案。

(繼承來源 UIElement)
IsHorizontalRailEnabled

取得或設定值,這個值表示是否啟用水準軸的捲軸。

IsHorizontalRailEnabledProperty

識別 IsHorizontalRailEnabled 相依性屬性。

IsHorizontalScrollChainingEnabled

取得或設定值,這個值表示水準軸是否從這個子系啟用捲動鏈結至其父系。

IsHorizontalScrollChainingEnabledProperty

識別 IsHorizontalScrollChainingEnabled 相依性屬性。

IsLoaded

取得值,這個值表示專案是否已加入至專案樹狀結構,且已準備好進行互動。

(繼承來源 FrameworkElement)
IsRightTapEnabled

取得或設定值,這個值會判斷 RightTapped 事件是否可以來自該專案。

(繼承來源 UIElement)
IsScrollInertiaEnabled

取得或設定值,這個值表示捲動動作是否應該在其行為和值中包含慣性。

IsScrollInertiaEnabledProperty

識別 IsScrollInertiaEnabled 相依性屬性。

IsTabStop

取得或設定值,這個值表示控制項是否包含於索引標籤巡覽。

(繼承來源 Control)
IsTapEnabled

取得或設定值,這個值會決定 Tapped 事件是否可以來自該專案。

(繼承來源 UIElement)
IsTextScaleFactorEnabled

取得或設定是否啟用自動放大文字,以反映系統文字大小設定。

(繼承來源 Control)
IsVerticalRailEnabled

取得或設定值,這個值表示是否啟用垂直軸的捲軸。

IsVerticalRailEnabledProperty

識別 IsVerticalRailEnabled 相依性屬性。

IsVerticalScrollChainingEnabled

取得或設定值,這個值表示垂直軸是否從這個子系啟用捲動鏈結至其父系。

IsVerticalScrollChainingEnabledProperty

識別 IsVerticalScrollChainingEnabled 相依性屬性。

IsZoomChainingEnabled

取得或設定值,這個值表示是否從這個子系啟用縮放鏈結至其父系。

IsZoomChainingEnabledProperty

識別 IsZoomChainingEnabled 相依性屬性。

IsZoomInertiaEnabled

取得或設定值,這個值表示縮放動作是否應該在其行為和值中包含慣性。

IsZoomInertiaEnabledProperty

識別 IsZoomInertiaEnabled 相依性屬性。

KeyboardAcceleratorPlacementMode

取得或設定值,這個值表示控制項 工具提示 是否顯示其相關聯鍵盤快速鍵的按鍵組合。

(繼承來源 UIElement)
KeyboardAcceleratorPlacementTarget

取得或設定值,這個值表示顯示快速鍵組合的控制項 工具提示

(繼承來源 UIElement)
KeyboardAccelerators

取得使用鍵盤叫用動作的按鍵組合集合。

快速鍵通常會指派給按鈕或功能表項目。

顯示各種功能表項目鍵盤快速鍵的功能表範例
顯示各種功能表項目鍵盤快速鍵的功能表範例

(繼承來源 UIElement)
KeyTipHorizontalOffset

取得或設定值,指出索引鍵提示相對於 UIElement 的左邊或右邊。

(繼承來源 UIElement)
KeyTipPlacementMode

取得或設定值,這個值表示存取索引鍵提示相對於 UIElement 界限的位置。

(繼承來源 UIElement)
KeyTipTarget

取得或設定值,這個值表示存取索引鍵提示的目標專案。

(繼承來源 UIElement)
KeyTipVerticalOffset

取得或設定值,這個值表示相對於 UI 元素放置索引鍵提示的上下距離。

(繼承來源 UIElement)
Language

取得或設定套用至 FrameworkElement的當地語系化/全球化語言資訊,以及套用至物件標記法和 UI 中目前 FrameworkElement 的所有子項目。

(繼承來源 FrameworkElement)
LeftHeader

取得或設定左標頭的內容。

LeftHeaderProperty

識別 LeftHeader 相依性屬性。

Lights

取得附加至這個專案的 XamlLight 物件集合。

(繼承來源 UIElement)
ManipulationMode

取得或設定用於UIElement行為與手勢互動的ManipulationModes值。 設定此值可讓您處理來自應用程式程式碼中這個專案的操作事件。

(繼承來源 UIElement)
Margin

取得或設定 FrameworkElement的外部邊界。

(繼承來源 FrameworkElement)
MaxHeight

取得或設定 FrameworkElement的最大高度條件約束。

(繼承來源 FrameworkElement)
MaxWidth

取得或設定 FrameworkElement的最大寬度條件約束。

(繼承來源 FrameworkElement)
MaxZoomFactor

取得或設定值,這個值表示 ZoomFactor允許的運行時間值上限。

MaxZoomFactorProperty

識別 MaxZoomFactor 相依性屬性。

MinHeight

取得或設定 FrameworkElement的最小高度條件約束。

(繼承來源 FrameworkElement)
MinWidth

取得或設定 FrameworkElement的最小寬度條件約束。

(繼承來源 FrameworkElement)
MinZoomFactor

取得或設定值,這個值表示 ZoomFactor的最小允許運行時間值。

MinZoomFactorProperty

識別 MinZoomFactor 相依性屬性。

Name

取得或設定 物件的識別名稱。 當 XAML 處理器從 XAML 標記建立物件樹狀結構時,執行時間程式碼可以透過這個名稱參考 XAML 宣告的物件。

(繼承來源 FrameworkElement)
Opacity

取得或設定物件的不透明度程度。

(繼承來源 UIElement)
OpacityTransition

取得或設定 ScalarTransition,以動畫顯示 Opacity 屬性的變更。

(繼承來源 UIElement)
Padding

取得或設定控制項內部的邊框間距。

(繼承來源 Control)
Parent

取得物件樹狀結構中這個 FrameworkElement 的父物件。

(繼承來源 FrameworkElement)
PointerCaptures

取得所有擷取指標的集合,表示為 指標 值。

(繼承來源 UIElement)
Projection

取得或設定轉譯這個專案時要套用的 3D 效果) (3D 效果。

(繼承來源 UIElement)
ReduceViewportForCoreInputViewOcclusions

取得或設定值,指出 ScrollViewer 是否應該嘗試調整其內容,使其在停駐的 CoreInputView 遮蔽部分時保持可見。

ReduceViewportForCoreInputViewOcclusionsProperty

識別 ReduceViewportForCoreInputViewOcclusions 相依性屬性。

RenderSize

取得 UIElement的最終轉譯大小。 不建議使用,請參閱。

(繼承來源 UIElement)
RenderTransform

取得或設定會影響 UIElement轉譯位置的轉換資訊。

(繼承來源 UIElement)
RenderTransformOrigin

取得或設定 RenderTransform所宣告之任何可能轉譯轉換的原點,相對於 UIElement的界限。

(繼承來源 UIElement)
RequestedTheme

取得或設定 UIElement (及其子項目) 用於資源判斷的 UI 主題。 您使用 RequestedTheme 指定的 UI 主題可以覆寫應用層級 RequestedTheme

(繼承來源 FrameworkElement)
RequiresPointer

取得或設定 UI 元素是否支援滑鼠模式,以模擬非指標輸入裝置的指標互動體驗,例如遊戲台或遠端控制。

(繼承來源 Control)
Resources

取得本機定義的資源字典。 在 XAML 中,您可以透過 XAML 隱含集合語法,將資源專案建立為屬性專案的子物件專案 frameworkElement.Resources

(繼承來源 FrameworkElement)
Rotation

取得或設定順時針旋轉的角度,以度為單位。 相對於 RotationAxis 和 CenterPoint 旋轉。 影響專案的轉譯位置。

(繼承來源 UIElement)
RotationAxis

取得或設定座標軸,以繞著旋轉專案。

(繼承來源 UIElement)
RotationTransition

取得或設定 ScalarTransition,以動畫顯示 Rotation 屬性的變更。

(繼承來源 UIElement)
Scale

取得或設定專案的刻度。 相對於專案的 CenterPoint 進行調整。 影響專案的轉譯位置。

(繼承來源 UIElement)
ScaleTransition

取得或設定 Vector3Transition,以動畫顯示 Scale 屬性的變更。

(繼承來源 UIElement)
ScrollableHeight

取得值,表示可以捲動的區域垂直大小;範圍的高度與檢視區的高度之間的差異。

ScrollableHeightProperty

識別 ScrollableHeight 相依性屬性。

ScrollableWidth

取得值,表示可以捲動的區域水準大小;範圍寬度與檢視區寬度之間的差異。

ScrollableWidthProperty

識別 ScrollableWidth 相依性屬性。

Shadow

取得或設定 元素所轉換的陰影效果。

(繼承來源 UIElement)
Style

取得或設定配置和轉譯期間針對這個物件套用的實例 Style

(繼承來源 FrameworkElement)
TabFocusNavigation

取得或設定值,這個值會修改 Tabbing 和 TabIndex 對此控制項的運作方式。

(繼承來源 UIElement)
TabIndex

取得或設定值,指出當使用者使用 Tab 鍵流覽應用程式 UI 時,元素接收焦點的順序。

(繼承來源 Control)
TabNavigation

取得或設定值,這個值會修改 Tabbing 和 TabIndex 對此控制項的運作方式。

注意

針對Windows 10 Creators Update (組建 10.0.15063) 和更新版本,TabFocusNavigation屬性可在UIElement基類上使用,以在不使用ControlTemplate的索引標籤序列中包含物件。

(繼承來源 Control)
Tag

取得或設定任意物件值,可用來儲存這個物件的自訂資訊。

(繼承來源 FrameworkElement)
Template

取得或設定控制項範本。 控制項範本會定義 UI 中控制項的視覺外觀,並在 XAML 標記中定義。

(繼承來源 Control)
TopHeader

取得或設定頂端標頭的內容。

TopHeaderProperty

識別 TopHeader 相依性屬性。

TopLeftHeader

取得或設定頂端、左標頭的內容。

TopLeftHeaderProperty

識別 TopLeftHeader 相依性屬性。

Transform3D

取得或設定轉譯這個專案時要套用的 3D 轉換效果。

(繼承來源 UIElement)
TransformMatrix

取得或設定要套用至專案的轉換矩陣。

(繼承來源 UIElement)
Transitions

取得或設定套用至UIElementTransition樣式專案集合。

(繼承來源 UIElement)
Translation

取得或設定專案的 x、y 和 z 轉譯位置。

(繼承來源 UIElement)
TranslationTransition

取得或設定 Vector3Transition,以動畫顯示 Translation 屬性的變更。

(繼承來源 UIElement)
Triggers

取得針對 FrameworkElement定義的動畫觸發程式集合。 不常使用。 請參閱<備註>。

(繼承來源 FrameworkElement)
UIContext

取得專案的內容識別碼。

(繼承來源 UIElement)
UseLayoutRounding

取得或設定值,這個值會決定物件及其視覺子樹的轉譯是否應該使用四捨五入行為,將轉譯對齊整個圖元。

(繼承來源 UIElement)
UseSystemFocusVisuals

取得或設定值,這個值表示控制項是否使用由系統或控制項範本中定義的焦點視覺效果。

(繼承來源 Control)
VerticalAlignment

取得或設定在面板或專案控制項等父物件中撰寫時套用至 FrameworkElement 的垂直對齊特性。

(繼承來源 FrameworkElement)
VerticalAnchorRatio

決定 ScrollViewer 錨點 相對於檢視區的垂直位置。 根據預設,ScrollViewer 會識別其檢視區最接近錨點的元素,以選取專案作為其 CurrentAnchor

VerticalAnchorRatioProperty

識別 VerticalAnchorRatio 相依性屬性。

VerticalContentAlignment

取得或設定控制項內容的垂直對齊。

(繼承來源 Control)
VerticalOffset

取得內容垂直捲動的距離。

VerticalOffsetProperty

識別 VerticalOffset 相依性屬性。

VerticalScrollBarVisibility

取得或設定值,指出是否應該顯示垂直 ScrollBar

VerticalScrollBarVisibilityProperty

識別 VerticalScrollBarVisibility 相 依性屬性。

VerticalScrollMode

取得或設定值,這個值會決定操作輸入如何影響垂直軸上的捲動行為。

VerticalScrollModeProperty

識別 VerticalScrollMode 相依性屬性。

VerticalSnapPointsAlignment

取得或設定值,指出現有貼齊點與初始檢視區垂直對齊的方式。

VerticalSnapPointsAlignmentProperty

識別 VerticalSnapPointsAlignment 相依性屬性。

VerticalSnapPointsType

取得或設定值,這個值會宣告操作行為如何回應垂直軸上的貼齊點。

VerticalSnapPointsTypeProperty

識別 VerticalSnapPointsType 相依性屬性。

ViewportHeight

取得可檢視內容的垂直大小。

ViewportHeightProperty

識別 ViewportHeight 相依性屬性。

ViewportWidth

取得可檢視內容的水準大小。

ViewportWidthProperty

識別 ViewportWidth 相依性屬性。

Visibility

取得或設定 UIElement的可見度。 不可見的 UIElement 不會轉譯,而且不會將其所需的大小傳達給版面配置。

(繼承來源 UIElement)
Width

取得或設定 FrameworkElement的寬度。

(繼承來源 FrameworkElement)
XamlRoot

取得或設定 XamlRoot 正在檢視這個專案的 。

(繼承來源 UIElement)
XYFocusDown

取得或設定當使用者按下方向板 (D 鍵) 向下時取得焦點的物件。

(繼承來源 Control)
XYFocusDownNavigationStrategy

取得或設定值,指定用來判斷向下導覽目標元素的策略。

(繼承來源 UIElement)
XYFocusKeyboardNavigation

取得或設定值,這個值會啟用或停用使用鍵盤方向箭號的流覽。

(繼承來源 UIElement)
XYFocusLeft

取得或設定當使用者按下方向板 (D 鍵) 左鍵時取得焦點的物件。

(繼承來源 Control)
XYFocusLeftNavigationStrategy

取得或設定值,指定用來判斷左側導覽目標元素的策略。

(繼承來源 UIElement)
XYFocusRight

取得或設定當使用者按下方向板 (D 鍵) 右鍵時取得焦點的物件。

(繼承來源 Control)
XYFocusRightNavigationStrategy

取得或設定值,指定用來判斷右導覽之目標元素的策略。

(繼承來源 UIElement)
XYFocusUp

取得或設定當使用者按下方向板 (D 鍵) 時取得焦點的物件。

(繼承來源 Control)
XYFocusUpNavigationStrategy

取得或設定值,指定用來判斷向上流覽目標元素的策略。

(繼承來源 UIElement)
ZoomFactor

取得值,這個值表示目前參與內容縮放比例的縮放比例。

ZoomFactorProperty

識別 ZoomFactor 相依性屬性。

ZoomMode

取得或設定值,指出是否啟用 ScrollViewer 內容中的縮放行為。

ZoomModeProperty

識別 ZoomMode 相依性屬性。

ZoomSnapPoints

取得 ScrollViewer所保留之縮放貼齊點因數的可觀察集合。

ZoomSnapPointsProperty

識別 ZoomSnapPoints 相依性屬性。

ZoomSnapPointsType

取得或設定值,這個值表示如何處理縮放貼齊點以進行互動輸入。

ZoomSnapPointsTypeProperty

識別 ZoomSnapPointsType 相依性屬性。

方法

AddHandler(RoutedEvent, Object, Boolean)

加入所指定路由事件的路由事件處理常式,會將此處理常式加入目前項目的處理常式集合中。 將 handledEventsToo 指定為 true ,以便叫用提供的處理常式,即使事件是在其他地方處理也一樣。

(繼承來源 UIElement)
ApplyTemplate()

載入相關的控制項範本,以便參考其元件。

(繼承來源 Control)
Arrange(Rect)

放置子物件,並決定 UIElement的大小。 為其子專案實作自訂配置的父物件應該從其版面配置覆寫實作呼叫此方法,以形成遞迴版面配置更新。

(繼承來源 UIElement)
ArrangeOverride(Size)

提供配置「排列」傳遞的行為。 類別可以覆寫這個方法,以定義自己的「排列」傳遞行為。

(繼承來源 FrameworkElement)
CancelDirectManipulations()

取消任何包含目前UIElementScrollViewer父代上 (系統定義的移動流覽/縮放) 進行中的直接操作處理。

(繼承來源 UIElement)
CapturePointer(Pointer)

設定 UIElement的指標擷取。 擷取之後,只有具有擷取的專案才會引發指標相關事件。

(繼承來源 UIElement)
ChangeView(IReference<Double>, IReference<Double>, IReference<Single>)

ScrollViewer 使用指定的位移和縮放因數,將新的檢視載入檢視區。

ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean)

ScrollViewer 使用指定的位移和縮放因數,將新的檢視載入檢視區,並選擇性地停用捲動動畫。

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
FindName(String)

擷取具有指定識別碼名稱的物件。

(繼承來源 FrameworkElement)
FindSubElementsForTouchTargeting(Point, Rect)

可讓 UIElement 子類別公開可協助解決觸控目標的子項目。

(繼承來源 UIElement)
Focus(FocusState)

嘗試設定控制項的焦點。

(繼承來源 Control)
GetAnimationBaseValue(DependencyProperty)

傳回針對相依性屬性所建立的任何基底值,如果動畫未使用中,則會套用。

(繼承來源 DependencyObject)
GetBindingExpression(DependencyProperty)

會傳回代表指定屬性上系結的 BindingExpression

(繼承來源 FrameworkElement)
GetBringIntoViewOnFocusChange(DependencyObject)

從指定的專案取得 BringIntoViewOnFocusChange 相依性屬性 / ScrollViewer.BringIntoViewOnFocusChange XAML 附加屬性的值。

GetCanContentRenderOutsideBounds(DependencyObject)

取得指定專案上 CanContentRenderOutsideBounds 相依性屬性 / ScrollViewer.CanContentRenderOutsideBounds XAML 附加屬性的值。

GetChildrenInTabFocusOrder()

可讓 UIElement 子類別公開參與 Tab 焦點的子項目。

(繼承來源 UIElement)
GetHorizontalScrollBarVisibility(DependencyObject)

從指定的專案取得 HorizontalScrollBarVisibility 相 依性屬性 / ScrollViewer.HorizontalScrollBarVisibility XAML 附加屬性的值。

GetHorizontalScrollMode(DependencyObject)

從指定的專案取得 HorizontalScrollMode 相依性屬性 / ScrollViewer.HorizontalScrollMode XAML 附加屬性的值。

GetIsDeferredScrollingEnabled(DependencyObject)

從指定的專案取得 IsDeferredScrollingEnabled 相依性屬性 / ScrollViewer.IsDeferredScrollingInertiaEnabled XAML 附加屬性的值。

GetIsHorizontalRailEnabled(DependencyObject)

從指定的專案取得 IsHorizontalRailEnabled 相依性屬性 / ScrollViewer.IsHorizontalRailEnabled XAML 附加屬性的值。

GetIsHorizontalScrollChainingEnabled(DependencyObject)

從指定的專案取得 IsHorizontalScrollChainingEnabled 相依性屬性 / ScrollViewer.IsHorizontalScrollChainingEnabled XAML 附加屬性的值。

GetIsScrollInertiaEnabled(DependencyObject)

從指定的專案取得 IsScrollInertiaEnabled 相依性屬性 / ScrollViewer.IsScrollInertiaEnabled XAML 附加屬性的值。

GetIsVerticalRailEnabled(DependencyObject)

從指定的專案取得 IsVerticalRailEnabled 相依性屬性 / ScrollViewer.IsVerticalRailEnabled XAML 附加屬性的值。

GetIsVerticalScrollChainingEnabled(DependencyObject)

從指定的專案取得 IsVerticalScrollChainingEnabled 相依性屬性 / ScrollViewer.IsVerticalScrollChainingEnabled XAML 附加屬性的值。

GetIsZoomChainingEnabled(DependencyObject)

從指定的專案取得 IsZoomChainingEnabled 相依性屬性 / ScrollViewer.IsZoomChainingEnabled XAML 附加屬性的值。

GetIsZoomInertiaEnabled(DependencyObject)

從指定的專案取得 IsZoomInertiaEnabled 相依性屬性 / ScrollViewer.IsZoomInertiaEnabled XAML 附加屬性的值。

GetTemplateChild(String)

擷取具現化 ControlTemplate 視覺化樹狀結構中的具名專案。

(繼承來源 Control)
GetValue(DependencyProperty)

DependencyObject傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
GetVerticalScrollBarVisibility(DependencyObject)

從指定的專案取得 VerticalScrollBarVisibility 相 依性屬性 / ScrollViewer.VerticalScrollBarVisibility XAML 附加屬性的值。

GetVerticalScrollMode(DependencyObject)

從指定的專案取得 VerticalScrollMode 相依性屬性 / ScrollViewer.VerticalScrollMode XAML 附加屬性的值。

GetZoomMode(DependencyObject)

從指定的專案取得 ZoomMode 相依性屬性 / ScrollViewer.ZoomMode XAML 附加屬性的值。

GoToElementStateCore(String, Boolean)

在衍生類別中實作時,可在程式碼中啟用控制項範本的個別狀態建構視覺化樹狀結構,而不是在控制項啟動時載入所有狀態的 XAML。

(繼承來源 FrameworkElement)
InvalidateArrange()

使 UIElement的排列狀態 (配置) 失效。 無效之後, UIElement 會更新其版面配置,這會以非同步方式發生。

(繼承來源 UIElement)
InvalidateMeasure()

使 UIElement的度量狀態 (配置) 失效。

(繼承來源 UIElement)
InvalidateScrollInfo()

當描述捲動區域大小和位置的屬性值變更時呼叫。

InvalidateViewport()

使用來計算有效檢視區的UIElement檢視區狀態失效。

(繼承來源 FrameworkElement)
Measure(Size)

匯報UIElementDesiredSize。 一般而言,針對其版面配置子系實作實作自訂配置的物件,會從自己的 MeasureOverride 實作呼叫這個方法,以形成遞迴版面配置更新。

(繼承來源 UIElement)
MeasureOverride(Size)

提供配置週期的「量值」傳遞行為。 類別可以覆寫這個方法,以定義自己的「量值」傳遞行為。

(繼承來源 FrameworkElement)
OnApplyTemplate()

每當應用程式程式碼或內部進程 (,例如重建版面配置傳遞) 呼叫 ApplyTemplate時叫用。 在最簡單的詞彙中,這表示方法只會在應用程式中顯示 UI 元素之前呼叫。 覆寫這個方法,以影響類別的預設範本後邏輯。

(繼承來源 FrameworkElement)
OnBringIntoViewRequested(BringIntoViewRequestedEventArgs)

BringIntoViewRequested 事件發生之前呼叫。

(繼承來源 UIElement)
OnCharacterReceived(CharacterReceivedRoutedEventArgs)

CharacterReceived 事件發生之前呼叫。

(繼承來源 Control)
OnContentChanged(Object, Object)

當 Content屬性的值變更時叫用。

(繼承來源 ContentControl)
OnContentTemplateChanged(DataTemplate, DataTemplate)

當 ContentTemplate屬性的值變更時叫用。

(繼承來源 ContentControl)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

ContentTemplateSelector 屬性的值變更時叫用。

(繼承來源 ContentControl)
OnCreateAutomationPeer()

在衍生類別中實作時,會傳回 Microsoft 消費者介面自動化 基礎結構的類別特定AutomationPeer實作。

(繼承來源 UIElement)
OnDisconnectVisualChildren()

覆寫這個方法,以實作從類別特定內容或子系屬性移除專案時,配置和邏輯的行為。

(繼承來源 UIElement)
OnDoubleTapped(DoubleTappedRoutedEventArgs)

DoubleTapped 事件發生之前呼叫。

(繼承來源 Control)
OnDragEnter(DragEventArgs)

DragEnter 事件發生之前呼叫。

(繼承來源 Control)
OnDragLeave(DragEventArgs)

DragLeave 事件發生之前呼叫。

(繼承來源 Control)
OnDragOver(DragEventArgs)

DragOver 事件發生之前呼叫。

(繼承來源 Control)
OnDrop(DragEventArgs)

Drop 事件發生之前呼叫。

(繼承來源 Control)
OnGotFocus(RoutedEventArgs)

GotFocus 事件發生之前呼叫。

(繼承來源 Control)
OnHolding(HoldingRoutedEventArgs)

發生 Holding事件之前呼叫。

(繼承來源 Control)
OnKeyboardAcceleratorInvoked(KeyboardAcceleratorInvokedEventArgs)

在應用程式中處理 鍵盤快速鍵 (或快速鍵) 時呼叫。 覆寫這個方法,以處理叫用鍵盤快速鍵時應用程式回應的方式。

(繼承來源 UIElement)
OnKeyDown(KeyRoutedEventArgs)

KeyDown 事件發生之前呼叫。

(繼承來源 Control)
OnKeyUp(KeyRoutedEventArgs)

KeyUp 事件發生之前呼叫。

(繼承來源 Control)
OnLostFocus(RoutedEventArgs)

LostFocus 事件發生之前呼叫。

(繼承來源 Control)
OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)

ManipulationCompleted 事件發生之前呼叫。

(繼承來源 Control)
OnManipulationDelta(ManipulationDeltaRoutedEventArgs)

ManipulationDelta 事件發生之前呼叫。

(繼承來源 Control)
OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)

ManipulationInertiaStarting 事件發生之前呼叫。

(繼承來源 Control)
OnManipulationStarted(ManipulationStartedRoutedEventArgs)

ManipulationStarted 事件發生之前呼叫。

(繼承來源 Control)
OnManipulationStarting(ManipulationStartingRoutedEventArgs)

ManipulationStarting 事件發生之前呼叫。

(繼承來源 Control)
OnPointerCanceled(PointerRoutedEventArgs)

PointerCanceled 事件發生之前呼叫。

(繼承來源 Control)
OnPointerCaptureLost(PointerRoutedEventArgs)

PointerCaptureLost 事件發生之前呼叫。

(繼承來源 Control)
OnPointerEntered(PointerRoutedEventArgs)

PointerEntered 事件發生之前呼叫。

(繼承來源 Control)
OnPointerExited(PointerRoutedEventArgs)

PointerExited 事件發生之前呼叫。

(繼承來源 Control)
OnPointerMoved(PointerRoutedEventArgs)

PointerMoved 事件發生之前呼叫。

(繼承來源 Control)
OnPointerPressed(PointerRoutedEventArgs)

PointerPressed 事件發生之前呼叫。

(繼承來源 Control)
OnPointerReleased(PointerRoutedEventArgs)

PointerReleased 事件發生之前呼叫。

(繼承來源 Control)
OnPointerWheelChanged(PointerRoutedEventArgs)

PointerWheelChanged 事件發生之前呼叫。

(繼承來源 Control)
OnPreviewKeyDown(KeyRoutedEventArgs)

PreviewKeyDown 事件發生之前呼叫。

(繼承來源 Control)
OnPreviewKeyUp(KeyRoutedEventArgs)

PreviewKeyUp 事件發生之前呼叫。

(繼承來源 Control)
OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

在應用程式中處理 鍵盤快速鍵 (或快速鍵) 之前呼叫。 每當應用程式程式碼或內部進程呼叫 ProcessKeyboardAccelerators時叫用。 覆寫此方法以影響預設加速器處理。

(繼承來源 UIElement)
OnRightTapped(RightTappedRoutedEventArgs)

RightTapped 事件發生之前呼叫。

(繼承來源 Control)
OnTapped(TappedRoutedEventArgs)

選事件發生之前呼叫。

(繼承來源 Control)
PopulatePropertyInfo(String, AnimationPropertyInfo)

定義可以產生動畫效果的屬性。

(繼承來源 UIElement)
PopulatePropertyInfoOverride(String, AnimationPropertyInfo)

在衍生類別中覆寫時,定義可產生動畫效果的屬性。

(繼承來源 UIElement)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterAnchorCandidate(UIElement)

UIElement 註冊為潛在的捲動錨點。

RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此DependencyObject實例上特定DependencyProperty的變更。

(繼承來源 DependencyObject)
ReleasePointerCapture(Pointer)

釋放指標擷取,以便透過這個 UIElement擷取一個特定指標。

(繼承來源 UIElement)
ReleasePointerCaptures()

釋放這個專案保留的所有指標擷取。

(繼承來源 UIElement)
RemoveFocusEngagement()

從控制項的控制項界限釋放焦點,該控制項具有遊戲台/遠端互動 () 。

(繼承來源 Control)
RemoveHandler(RoutedEvent, Object)

從這個 UIElement移除指定的路由事件處理常式。 一般而言,有問題的處理常式是由 AddHandler所新增。

(繼承來源 UIElement)
ScrollToHorizontalOffset(Double)

注意

ScrollToHorizontalOffset 可能會在Windows 8.1之後變更或無法使用版本。 請改用 ChangeView

ScrollViewer 內的內容捲動至指定的水準位移位置。

ScrollToVerticalOffset(Double)

注意

scrollToVerticalOffset 可能會在Windows 8.1之後變更或無法使用版本。 請改用 ChangeView

ScrollViewer 內的內容捲動至指定的垂直位移位置。

SetBinding(DependencyProperty, BindingBase)

使用提供的系結物件,將系結附加至 FrameworkElement

(繼承來源 FrameworkElement)
SetBringIntoViewOnFocusChange(DependencyObject, Boolean)

在指定的專案上設定 BringIntoViewOnFocusChange 相依性屬性 / ScrollViewer.BringIntoViewOnFocusChange XAML 附加屬性的值。

SetCanContentRenderOutsideBounds(DependencyObject, Boolean)

設定指定專案上 CanContentRenderOutsideBounds 相依性屬性 / ScrollViewer.CanContentRenderOutsideBounds XAML 附加屬性的值。

SetHorizontalScrollBarVisibility(DependencyObject, ScrollBarVisibility)

在指定的專案上設定 HorizontalScrollBarVisibility 相 依性屬性 / ScrollViewer.HorizontalScrollBarVisibility XAML 附加屬性的值。

SetHorizontalScrollMode(DependencyObject, ScrollMode)

在指定的專案上設定 HorizontalScrollMode 相依性屬性 / ScrollViewer.HorizontalScrollMode XAML 附加屬性的值。

SetIsDeferredScrollingEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsDeferredScrollingEnabled 相依性屬性 / ScrollViewer.IsDeferredScrollingEnabled XAML 附加屬性的值。

SetIsHorizontalRailEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsHorizontalRailEnabled 相依性屬性 / ScrollViewer.IsHorizontalRailEnabled XAML 附加屬性的值。

SetIsHorizontalScrollChainingEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsHorizontalScrollChainingEnabled 相依性屬性 / ScrollViewer.IsHorizontalScrollChainingEnabled XAML 附加屬性的值。

SetIsScrollInertiaEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsScrollInertiaEnabled 相依性屬性 / ScrollViewer.IsScrollInertiaEnabled XAML 附加屬性的值。

SetIsVerticalRailEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsVerticalRailEnabled 相依性屬性 / ScrollViewer.IsVerticalRailEnabled XAML 附加屬性的值。

SetIsVerticalScrollChainingEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsVerticalScrollChainingEnabled 相依性屬性 / ScrollViewer.IsVerticalScrollChainingEnabled XAML 附加屬性的值。

SetIsZoomChainingEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsZoomChainingEnabled 相依性屬性 / ScrollViewer.IsZoomChainingEnabled XAML 附加屬性的值。

SetIsZoomInertiaEnabled(DependencyObject, Boolean)

在指定的專案上設定 IsZoomInertiaEnabled 相依性屬性 / ScrollViewer.IsZoomInertiaEnabled XAML 附加屬性的值。

SetValue(DependencyProperty, Object)

DependencyObject上設定相依性屬性的本機值。

(繼承來源 DependencyObject)
SetVerticalScrollBarVisibility(DependencyObject, ScrollBarVisibility)

在指定的專案上設定 VerticalScrollBarVisibility 相 依性屬性 / ScrollViewer.VerticalScrollBarVisibility XAML 附加屬性的值。

SetVerticalScrollMode(DependencyObject, ScrollMode)

在指定的專案上設定 VerticalScrollMode 相依性屬性 / ScrollViewer.VerticalScrollMode XAML 附加屬性的值。

SetZoomMode(DependencyObject, ZoomMode)

在指定的專案上設定 ZoomMode 相依性屬性 / ScrollViewer.ZoomMode XAML 附加屬性的值。

StartAnimation(ICompositionAnimationBase)

開始專案上的指定動畫。

(繼承來源 UIElement)
StartBringIntoView()

起始 XAML 架構的要求,以將專案帶入其內含的任何可捲動區域中的檢視。

(繼承來源 UIElement)
StartBringIntoView(BringIntoViewOptions)

使用指定的選項,起始 XAML 架構的要求,以將專案帶入檢視。

(繼承來源 UIElement)
StartDragAsync(PointerPoint)

啟始拖放作業。

(繼承來源 UIElement)
StopAnimation(ICompositionAnimationBase)

停止專案上的指定動畫。

(繼承來源 UIElement)
TransformToVisual(UIElement)

傳回轉換物件,這個物件可用來將 座標從 UIElement 轉換成指定的物件。

(繼承來源 UIElement)
TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

嘗試搜尋 UIElement 的整個視覺化樹狀結構,以叫用 鍵盤快速鍵 (或快速鍵)

(繼承來源 UIElement)
UnregisterAnchorCandidate(UIElement)

UIElement 取消註冊為潛在的捲動錨點。

UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback註冊的變更通知。

(繼承來源 DependencyObject)
UpdateLayout()

確保 UIElement 子物件的所有位置都已針對版面配置正確更新。

(繼承來源 UIElement)
ZoomToFactor(Single)

注意

ZoomToFactor 可能會在Windows 8.1之後變更或無法使用版本。 請改用 ChangeView

設定 ZoomFactor的有效值。

事件

AccessKeyDisplayDismissed

發生于不應再顯示存取金鑰時。

(繼承來源 UIElement)
AccessKeyDisplayRequested

發生于使用者要求顯示存取金鑰時。

(繼承來源 UIElement)
AccessKeyInvoked

發生于使用者完成存取金鑰序列時。

(繼承來源 UIElement)
ActualThemeChanged

發生于 ActualTheme 屬性值已變更時。

(繼承來源 FrameworkElement)
AnchorRequested

發生于 Arrange pass 開頭要求錨點時。 處理此事件以覆寫 ScrollViewer 的預設邏輯,以選取錨點元素做為捲動 錨定的一部分。

BringIntoViewRequested

在這個專案或其中一個子代上呼叫 StartBringIntoView 時發生。

(繼承來源 UIElement)
CharacterReceived

發生于輸入佇列收到單一、撰寫的字元時。

(繼承來源 UIElement)
ContextCanceled

發生于內容輸入手勢繼續進入操作手勢時,通知專案不應開啟內容飛出視窗。

(繼承來源 UIElement)
ContextRequested

發生于使用者已完成內容輸入手勢時,例如按一下滑鼠右鍵。

(繼承來源 UIElement)
DataContextChanged

發生于 FrameworkElement.DataCoNtext 屬性的值變更時。

(繼承來源 FrameworkElement)
DirectManipulationCompleted

發生于 ScrollViewer 的任何直接操作完成時。

DirectManipulationStarted

發生于 ScrollViewer 的任何直接操作開始時。

DoubleTapped

發生于在此元素的點擊測試區域上發生未處理的 DoubleTap 互動時。

(繼承來源 UIElement)
DragEnter

當輸入系統報告基礎拖曳事件,並將這個專案當做目標時發生。

(繼承來源 UIElement)
DragLeave

當輸入系統報告基礎拖曳事件,並將這個專案當做原點時發生。

(繼承來源 UIElement)
DragOver

在輸入系統回報以此項目作為可能置放目標的基礎拖曳事件時發生。

(繼承來源 UIElement)
DragStarting

發生于起始拖曳作業時。

(繼承來源 UIElement)
Drop

輸入系統報告其下以這個項目作為置放目標的置放事件時發生。

(繼承來源 UIElement)
DropCompleted

發生于以這個專案做為結束來源的拖放作業時。

(繼承來源 UIElement)
EffectiveViewportChanged

發生于 FrameworkElement的有效檢視區 變更時。

(繼承來源 FrameworkElement)
FocusDisengaged

當焦點從遊戲台/遠端互動 () 的控制項界限釋放時發生。

(繼承來源 Control)
FocusEngaged

發生于控制項界限內限制焦點時, (遊戲台/遠端互動) 。

(繼承來源 Control)
GettingFocus

發生于 UIElement 收到焦點之前。 此事件會同步引發,以確保事件反升時不會移動焦點。

(繼承來源 UIElement)
GotFocus

發生于 UIElement 收到焦點時。 此事件會以非同步方式引發,因此焦點可以在反升完成之前再次移動。

(繼承來源 UIElement)
Holding

發生于在此元素的點擊測試區域上發生未處理的 保留 互動時。

(繼承來源 UIElement)
IsEnabledChanged

發生于 IsEnabled 屬性變更時。

(繼承來源 Control)
KeyDown

UIElement 有焦點時按下鍵盤按鍵時發生。

(繼承來源 UIElement)
KeyUp

發生于 UIElement 有焦點時放開鍵盤按鍵時。

(繼承來源 UIElement)
LayoutUpdated

發生于視覺化樹狀結構的版面配置變更時,因為配置相關屬性變更值或重新整理版面配置的其他動作。

(繼承來源 FrameworkElement)
Loaded

發生于 架構Element 已建構並新增至物件樹狀結構,並準備好進行互動時。

(繼承來源 FrameworkElement)
Loading

FrameworkElement 開始載入時發生。

(繼承來源 FrameworkElement)
LosingFocus

發生于 UIElement 失去焦點之前。 此事件會同步引發,以確保事件反升時不會移動焦點。

(繼承來源 UIElement)
LostFocus

發生于 UIElement 失去焦點時。 此事件會以非同步方式引發,因此焦點可以在反升完成之前再次移動。

(繼承來源 UIElement)
ManipulationCompleted

發生于 UIElement 上的操作完成時。

(繼承來源 UIElement)
ManipulationDelta

輸入裝置在操作期間變更位置時發生。

(繼承來源 UIElement)
ManipulationInertiaStarting

在操作和慣性開始的時候,只要輸入裝置不與 UIElement 物件接觸便發生。

(繼承來源 UIElement)
ManipulationStarted

當輸入裝置開始在 UIElement 進行操作時發生。

(繼承來源 UIElement)
ManipulationStarting

發生於第一次建立操作處理器時。

(繼承來源 UIElement)
NoFocusCandidateFound

發生于使用者嘗試透過索引標籤或方向箭號移動焦點 () ,但焦點不會移動,因為不會在移動方向找到任何焦點候選項目。

(繼承來源 UIElement)
PointerCanceled

發生于讓連絡人異常失去連絡人的指標時。

(繼承來源 UIElement)
PointerCaptureLost

發生于這個專案先前保留的指標擷取移至另一個專案或其他地方時。

(繼承來源 UIElement)
PointerEntered

發生于指標進入這個專案的點擊測試區域時。

(繼承來源 UIElement)
PointerExited

發生于指標離開這個專案的點擊測試區域時。

(繼承來源 UIElement)
PointerMoved

當指標在指標保留在這個專案的點擊測試區域中時移動時發生。

(繼承來源 UIElement)
PointerPressed

發生于指標裝置在這個專案內起始 Press 動作時。

(繼承來源 UIElement)
PointerReleased

發生于先前起始 按下 動作的指標裝置放開時,同時在此元素內。 請注意, 按下動作的 結尾不保證會引發 PointerReleased 事件;其他事件可能會改為引發。 如需詳細資訊,請參閱。

(繼承來源 UIElement)
PointerWheelChanged

發生于指標滾輪的差異值變更時。

(繼承來源 UIElement)
PreviewKeyDown

UIElement 有焦點時按下鍵盤按鍵時發生。

(繼承來源 UIElement)
PreviewKeyUp

發生于 UIElement 有焦點時放開鍵盤按鍵時。

(繼承來源 UIElement)
ProcessKeyboardAccelerators

發生于按下 鍵盤快速鍵 (或快速鍵) 時。

(繼承來源 UIElement)
RightTapped

發生于在指標位於 元素上方時發生右鍵輸入回應時。

(繼承來源 UIElement)
SizeChanged

發生于 ActualHeightActualWidth 屬性變更 FrameworkElement上的值時。

(繼承來源 FrameworkElement)
Tapped

發生于未處理的 選互動發生于這個專案的點擊測試區域。

(繼承來源 UIElement)
Unloaded

當這個物件不再連接到主物件樹狀結構時發生。

(繼承來源 FrameworkElement)
ViewChanged

發生于捲動和縮放等操作導致檢視變更時。

ViewChanging

發生于捲動和縮放等操作會導致檢視變更時。

適用於

另請參閱