RichEditBox 类

定义

表示支持格式化文本、超链接和其他丰富内容的 RTF 编辑控件。

/// [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 RichEditBox : Control
[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 class RichEditBox : Control
Public Class RichEditBox
Inherits Control
<RichEditBox .../>

继承
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

示例

提示

有关详细信息、设计指南和代码示例,请参阅 Rich edit box

如果已安装 WinUI 2 库 应用,请单击此处 打开该应用并查看 RichEditBox 的实际应用

此示例演示如何使用 ITextDocument.SetText 方法以编程方式将文本添加到 RichEditBox。

<RichEditBox x:Name="richEditBox" Width="500" Header="Notes"/>
richEditBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, "This is some sample text");

以下示例显示了如何在 RichEditBox 中编辑、加载并保存富文本格式 (.rtf) 文件。

<RelativePanel Margin="20" HorizontalAlignment="Stretch">
    <RelativePanel.Resources>
        <Style TargetType="AppBarButton">
            <Setter Property="IsCompact" Value="True"/>
        </Style>
    </RelativePanel.Resources>
    <AppBarButton x:Name="openFileButton" Icon="OpenFile" 
                  Click="OpenButton_Click" ToolTipService.ToolTip="Open file"/>
    <AppBarButton Icon="Save" Click="SaveButton_Click" 
                  ToolTipService.ToolTip="Save file" 
                  RelativePanel.RightOf="openFileButton" Margin="8,0,0,0"/>

    <AppBarButton Icon="Bold" Click="BoldButton_Click" ToolTipService.ToolTip="Bold" 
                  RelativePanel.LeftOf="italicButton" Margin="0,0,8,0"/>
    <AppBarButton x:Name="italicButton" Icon="Italic" Click="ItalicButton_Click" 
                  ToolTipService.ToolTip="Italic" RelativePanel.LeftOf="underlineButton" Margin="0,0,8,0"/>
    <AppBarButton x:Name="underlineButton" Icon="Underline" Click="UnderlineButton_Click" 
                  ToolTipService.ToolTip="Underline" RelativePanel.AlignRightWithPanel="True"/>


    <RichEditBox x:Name="editor" Height="200" RelativePanel.Below="openFileButton" 
                 RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True"/>
</RelativePanel>
private async void OpenButton_Click(object sender, RoutedEventArgs e)
{
    // Open a text file.
    Windows.Storage.Pickers.FileOpenPicker open =
        new Windows.Storage.Pickers.FileOpenPicker();
    open.SuggestedStartLocation =
        Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;
    open.FileTypeFilter.Add(".rtf");

    Windows.Storage.StorageFile file = await open.PickSingleFileAsync();

    if (file != null)
    {
        try
        {
            Windows.Storage.Streams.IRandomAccessStream randAccStream =
        await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

            // Load the file into the Document property of the RichEditBox.
            editor.Document.LoadFromStream(Windows.UI.Text.TextSetOptions.FormatRtf, randAccStream);
        }
        catch (Exception)
        {
            ContentDialog errorDialog = new ContentDialog()
            {
                Title = "File open error",
                Content = "Sorry, I couldn't open the file.",
                PrimaryButtonText = "Ok"
            };

            await errorDialog.ShowAsync();
        }
    }
}

private async void SaveButton_Click(object sender, RoutedEventArgs e)
{
    Windows.Storage.Pickers.FileSavePicker savePicker = new Windows.Storage.Pickers.FileSavePicker();
    savePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;

    // Dropdown of file types the user can save the file as
    savePicker.FileTypeChoices.Add("Rich Text", new List<string>() { ".rtf" });

    // Default file name if the user does not type one in or select a file to replace
    savePicker.SuggestedFileName = "New Document";

    Windows.Storage.StorageFile file = await savePicker.PickSaveFileAsync();
    if (file != null)
    {
        // Prevent updates to the remote version of the file until we 
        // finish making changes and call CompleteUpdatesAsync.
        Windows.Storage.CachedFileManager.DeferUpdates(file);
        // write to file
        Windows.Storage.Streams.IRandomAccessStream randAccStream =
            await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);

        editor.Document.SaveToStream(Windows.UI.Text.TextGetOptions.FormatRtf, randAccStream);

        // Let Windows know that we're finished changing the file so the 
        // other app can update the remote version of the file.
        Windows.Storage.Provider.FileUpdateStatus status = await Windows.Storage.CachedFileManager.CompleteUpdatesAsync(file);
        if (status != Windows.Storage.Provider.FileUpdateStatus.Complete)
        {
            Windows.UI.Popups.MessageDialog errorBox =
                new Windows.UI.Popups.MessageDialog("File " + file.Name + " couldn't be saved.");
            await errorBox.ShowAsync();
        }
    }
}

private void BoldButton_Click(object sender, RoutedEventArgs e)
{
    Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
    if (selectedText != null)
    {
        Windows.UI.Text.ITextCharacterFormat charFormatting = selectedText.CharacterFormat;
        charFormatting.Bold = Windows.UI.Text.FormatEffect.Toggle;
        selectedText.CharacterFormat = charFormatting;
    }
}

private void ItalicButton_Click(object sender, RoutedEventArgs e)
{
    Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
    if (selectedText != null)
    {
        Windows.UI.Text.ITextCharacterFormat charFormatting = selectedText.CharacterFormat;
        charFormatting.Italic = Windows.UI.Text.FormatEffect.Toggle;
        selectedText.CharacterFormat = charFormatting;
    }
}

private void UnderlineButton_Click(object sender, RoutedEventArgs e)
{
    Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
    if (selectedText != null)
    {
        Windows.UI.Text.ITextCharacterFormat charFormatting = selectedText.CharacterFormat;
        if (charFormatting.Underline == Windows.UI.Text.UnderlineType.None)
        {
            charFormatting.Underline = Windows.UI.Text.UnderlineType.Single;
        }
        else {
            charFormatting.Underline = Windows.UI.Text.UnderlineType.None;
        }
        selectedText.CharacterFormat = charFormatting;
    }
}

注解

提示

有关详细信息、设计指南和代码示例,请参阅 Rich edit box

RichEditBox 是允许用户输入带格式的文本(如加粗、斜体和带下划线)的控件。 RichEditBox 还可以显示 rtf 格式 (.rtf) 文档,包括超链接和图像 (.jpg、.png 等) 。 此控件专为高级文本编辑方案而设计。 对于简单的纯文本输入(如在窗体上),请考虑使用 TextBox

请使用 RichEditBox 的 Document 属性来获取其内容。 RichEditBox 的内容是 Windows.UI.Text.ITextDocument 对象,可用于访问基础 文本对象模型 API。 有关可用于处理文本文档的 API,请参阅 Windows.UI.Text 命名空间。

有关详细信息和示例,请参阅 RichEditBox 控件指南

笔输入

从 Windows 10 版本 1803 开始,XAML 文本输入框默认支持使用 Windows Ink 进行笔输入。 当用户使用 Windows 笔点击进入文本输入框时,文本框会进行转换,以允许用户直接用笔进行写入,而不是打开一个单独的输入面板。

带墨迹和提示的文本框

有关详细信息,请参阅带手写视图的文本输入

控件样式和模板

可以修改默认 的 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 还包括可用于在不修改控件模板的情况下修改不同视觉状态中的控件颜色的资源。 修改这些资源是首选设置属性,如 BackgroundForeground。 有关详细信息,请参阅 XAML 样式一文的轻量级样式部分。 从 Windows 10 版本 1607 (SDK 14393) 开始提供轻型样式资源。

TextControl 开头的资源由 TextBoxPasswordBoxRichEditBoxAutoSuggestBox 共享。 对这些资源的更改将影响所有四个控件。

版本历史记录

Windows 版本 SDK 版本 增值
1511 10586 ClipboardCopyFormat
1511 10586 GetLinguisticAlternativesAsync
1703 15063 MaxLength
1703 15063 SelectionHighlightColorWhenNotFocused
1709 16299 CharacterCasing
1709 16299 CopyingToClipboard
1709 16299 CuttingToClipboard
1709 16299 DisabledFormattingAccelerators
1709 16299 HorizontalTextAlignment
1803 17134 ContentLinkBackgroundColor
1803 17134 ContentLinkChanged
1803 17134 ContentLinkForegroundColor
1803 17134 ContentLinkInvoked
1803 17134 ContentLinkProviders
1803 17134 HandwritingView
1803 17134 IsHandwritingViewEnabled
1809 17763 说明
1809 17763 ProofingMenuFlyout
1809 17763 选择更改
1809 17763 SelectionFlyout
1809 17763 TextDocument

构造函数

RichEditBox()

初始化 RichEditBox 类的新实例。

属性

AcceptsReturn

获取或设置一个值,该值指示 RichEditBox 是否允许并在按下 Enter 或 RETURN 键时显示换行符或返回字符。

AcceptsReturnProperty

标识 AcceptsReturn 依赖属性。

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

获取或设置一个值,该值指示应尽可能将呈现的内容缓存为复合位图。

(继承自 UIElement)
CanBeScrollAnchor

获取或设置一个值,该值指示 UIElement 是否可以成为滚动定位的候选项。

(继承自 UIElement)
CanDrag

获取或设置一个值,该值指示是否可以在拖放操作中将元素作为数据拖动。

(继承自 UIElement)
CenterPoint

获取或设置 元素的中心点,该中心点是关于发生旋转或缩放的点。 影响元素的呈现位置。

(继承自 UIElement)
CharacterCasing

获取或设置一个值,该值指示控件在键入字符时如何修改大小写。

CharacterCasingProperty

标识 CharacterCasing 依赖属性。

CharacterSpacing

获取或设置字符之间的统一间距,单位为 1/1000 em。

(继承自 Control)
Clip

获取或设置用于定义 UIElement 内容的大纲的 RectangleGeometry

(继承自 UIElement)
ClipboardCopyFormat

获取或设置一个值,该值指定是使用所有格式复制文本,还是仅以纯文本形式复制文本。

ClipboardCopyFormatProperty

标识 ClipboardCopyFormat 依赖属性。

CompositeMode

获取或设置一个属性,该属性声明元素在其父布局和窗口中的替代组合和混合模式。 这与混合 XAML/Microsoft DirectX UI 中涉及的元素相关。

(继承自 UIElement)
ContentLinkBackgroundColor

获取或设置用于为链接背景着色的画笔。

ContentLinkBackgroundColorProperty

标识 ContentLinkBackgroundColor 依赖属性。

ContentLinkForegroundColor

获取或设置用于为链接文本着色的画笔。

ContentLinkForegroundColorProperty

标识 ContentLinkForegroundColor 依赖属性。

ContentLinkProviders

获取或设置 ContentLinkProvider的集合,该集合定义在此 RichEditBox 中使用的 ContentLink的类型。

ContentLinkProvidersProperty

标识 ContentLinkProviders 依赖属性。

ContextFlyout

获取或设置与此元素关联的浮出控件。

(继承自 UIElement)
CornerRadius

获取或设置控件边框角的半径。

(继承自 Control)
DataContext

获取或设置 FrameworkElement 的数据上下文。 数据上下文的常见用途是 FrameworkElement 使用 {Binding} 标记扩展并参与数据绑定。

(继承自 FrameworkElement)
DefaultStyleKey

获取或设置引用控件的默认样式的键。 自定义控件的作者使用此属性更改其控件使用的样式的默认值。

(继承自 Control)
DefaultStyleResourceUri

获取或设置包含控件的默认样式的资源文件的路径。

(继承自 Control)
Description

获取或设置 控件下方显示的内容。 内容应提供有关控件预期输入的指导。

DescriptionProperty

标识 Description 依赖属性。

DesiredCandidateWindowAlignment

获取或设置一个值,该值指示输入法编辑器 (输入法) 的首选对齐方式。

DesiredCandidateWindowAlignmentProperty

标识 DesiredCandidateWindowAlignment 依赖属性。

DesiredSize

获取此 UIElement 在布局过程的度量传递期间计算的大小。

(继承自 UIElement)
DisabledFormattingAccelerators

获取或设置一个值,该值指示禁用格式设置的键盘快捷方式。

DisabledFormattingAcceleratorsProperty

标识 DisabledFormattingAccelerators 依赖属性。

Dispatcher

获取与此 对象关联的 CoreDispatcherCoreDispatcher 表示可以访问 UI 线程上的 DependencyObject 的工具,即使代码是由非 UI 线程启动的。

(继承自 DependencyObject)
Document

获取一个 对象,该对象允许访问 RichEditBox 中包含的文本的文本对象模型。

ElementSoundMode

获取或设置一个值,该值指定控件是否播放声音的首选项。

(继承自 Control)
ExitDisplayModeOnAccessKeyInvoked

获取或设置一个值,该值指定在调用访问密钥时是否消除访问密钥显示。

(继承自 UIElement)
FlowDirection

获取或设置文本和其他 UI 元素在控制其布局的任何父元素中的流动方向。 此属性可以设置为 LeftToRightRightToLeft。 在任何元素上将 FlowDirection 设置为 RightToLeft 会将对齐方式设置为右对齐,将读取顺序设置为从右到左,并将控件的布局设置为从右到左流动。

(继承自 FrameworkElement)
FocusState

获取一个值,该值指定此控件是否具有焦点,以及获取焦点的模式。

(继承自 Control)
FocusVisualMargin

获取或设置 FrameworkElement 的焦点视觉对象的外边距。

(继承自 FrameworkElement)
FocusVisualPrimaryBrush

获取或设置用于绘制 FrameworkElementHighVisibilityReveal焦点视觉对象的外边框的画笔。

(继承自 FrameworkElement)
FocusVisualPrimaryThickness

获取或设置 FrameworkElementHighVisibilityReveal焦点视觉对象的外边框的粗细。

(继承自 FrameworkElement)
FocusVisualSecondaryBrush

获取或设置用于绘制 FrameworkElementHighVisibilityReveal焦点视觉对象的内边框的画笔。

(继承自 FrameworkElement)
FocusVisualSecondaryThickness

获取或设置 FrameworkElementHighVisibilityReveal焦点视觉对象的内边框的粗细。

(继承自 FrameworkElement)
FontFamily

获取或设置用于显示控件中的文本的字体。

(继承自 Control)
FontSize

获取或设置此控件中文本的大小。

(继承自 Control)
FontStretch

获取或设置字体在屏幕上紧缩或加宽的程度。

(继承自 Control)
FontStyle

获取或设置呈现文本的样式。

(继承自 Control)
FontWeight

获取或设置指定字体的粗细。

(继承自 Control)
Foreground

获取或设置一个用于描述前景色的画笔。

(继承自 Control)
HandwritingView

获取或设置与此文本控件关联的 HandwritingView

HandwritingViewProperty

标识 HandwritingView 依赖属性。

Header

获取或设置控件标头的内容。

HeaderProperty

标识 Header 依赖属性。

HeaderTemplate

获取或设置用于显示控件标头内容的 DataTemplate

HeaderTemplateProperty

标识 HeaderTemplate 依赖属性。

Height

获取或设置 FrameworkElement 的建议高度。

(继承自 FrameworkElement)
HighContrastAdjustment

获取或设置一个值,该值指示框架是否在启用高对比度主题时自动调整元素的视觉属性。

(继承自 UIElement)
HorizontalAlignment

获取或设置在布局父级(如面板或项控件)中组合时应用于 FrameworkElement 的水平对齐特征。

(继承自 FrameworkElement)
HorizontalContentAlignment

获取或设置控件内容的水平对齐方式。

(继承自 Control)
HorizontalTextAlignment

获取或设置一个值,该值指示文本在 RichEditBox 中的对齐方式。

HorizontalTextAlignmentProperty

标识 HorizontalTextAlignment 依赖属性。

InputScope

获取或设置此 RichEditBox 使用的输入的上下文。

InputScopeProperty

标识 InputScope 依赖属性。

IsAccessKeyScope

获取或设置一个值,该值指示元素是否定义其自己的访问键范围。

(继承自 UIElement)
IsColorFontEnabled

获取或设置一个值,该值确定是否以颜色呈现包含颜色层(如 Segoe UI 表情符号)的字体标志符号。

IsColorFontEnabledProperty

标识 IsColorFontEnabled 依赖属性。

IsDoubleTapEnabled

获取或设置一个值,该值确定 DoubleTapped 事件是否可以源自该元素。

(继承自 UIElement)
IsEnabled

获取或设置一个值,该值指示用户是否可以与控件交互。

(继承自 Control)
IsFocusEngaged

获取或设置一个值,该值指示焦点是否受限于游戏板/远程交互) 的控制边界 (。

(继承自 Control)
IsFocusEngagementEnabled

获取或设置一个值,该值指示是否可以在游戏板/远程交互) (控制边界内限制焦点。

(继承自 Control)
IsHandwritingViewEnabled

获取或设置一个值,该值指示用户是否可以在手写视图中输入文本。

IsHandwritingViewEnabledProperty

标识 IsHandwritingViewEnabled 依赖属性。

IsHitTestVisible

获取或设置此 UIElement 的包含区域是否可以为命中测试返回 true 值。

(继承自 UIElement)
IsHoldingEnabled

获取或设置一个值,该值确定 Holding 事件是否可以源自该元素。

(继承自 UIElement)
IsLoaded

获取一个值,该值指示元素是否已添加到元素树中并已准备好进行交互。

(继承自 FrameworkElement)
IsReadOnly

获取或设置一个值,该值指示用户是否可以更改 RichEditBox 中的文本。

IsReadOnlyProperty

标识 IsReadOnly 依赖属性。

IsRightTapEnabled

获取或设置一个值,该值确定 RightTapped 事件是否可以源自该元素。

(继承自 UIElement)
IsSpellCheckEnabled

获取或设置一个值,该值指示文本输入是否应与拼写检查引擎交互。

IsSpellCheckEnabledProperty

标识 IsSpellCheckEnabled 依赖属性。

IsTabStop

获取或设置一个值,该值指示是否将某个控件包含在 Tab 导航中。

(继承自 Control)
IsTapEnabled

获取或设置一个值,该值确定 点击 事件是否可以源自该元素。

(继承自 UIElement)
IsTextPredictionEnabled

获取或设置一个值,该值指示是否为此 RichEditBox 启用文本预测功能 (“自动完成”) 。

IsTextPredictionEnabledProperty

标识 IsTextPredictionEnabled 依赖属性。

IsTextScaleFactorEnabled

获取或设置是否启用自动文本放大,以反映系统文本大小设置。

(继承自 Control)
KeyboardAcceleratorPlacementMode

获取或设置一个值,该值指示控件 工具提示 是否显示其关联键盘快捷键的组合。

(继承自 UIElement)
KeyboardAcceleratorPlacementTarget

获取或设置一个值,该值指示显示快捷键组合的控件 工具提示

(继承自 UIElement)
KeyboardAccelerators

获取使用键盘调用操作的组合键的集合。

加速键通常分配给按钮或菜单项。

显示各种菜单项的键盘快捷键的菜单示例
显示各种菜单项的键盘快捷键的菜单示例

(继承自 UIElement)
KeyTipHorizontalOffset

获取或设置一个值,该值指示键提示相对于 UIElement 的左或右放置位置。

(继承自 UIElement)
KeyTipPlacementMode

获取或设置一个值,该值指示访问键提示相对于 UIElement 边界放置的位置。

(继承自 UIElement)
KeyTipTarget

获取或设置一个值,该值指示访问键提示所针对的元素。

(继承自 UIElement)
KeyTipVerticalOffset

获取或设置一个值,该值指示键提示相对于 UI 元素的放置距离。

(继承自 UIElement)
Language

获取或设置适用于 FrameworkElement 以及对象表示形式和 UI 中当前 FrameworkElement 的所有子元素的本地化/全球化语言信息。

(继承自 FrameworkElement)
Lights

获取附加到此元素的 XamlLight 对象的集合。

(继承自 UIElement)
ManipulationMode

获取或设置用于 UIElement 行为和手势交互的 ManipulationModes 值。 设置此值可处理应用代码中此元素的操作事件。

(继承自 UIElement)
Margin

获取或设置 FrameworkElement 的外部边距。

(继承自 FrameworkElement)
MaxHeight

获取或设置 FrameworkElement 的最大高度约束。

(继承自 FrameworkElement)
MaxLength

获取或设置值,该值指定用户输入允许的最大字符数。

MaxLengthProperty

标识 MaxLength 依赖属性。

MaxWidth

获取或设置 FrameworkElement 的最大宽度约束。

(继承自 FrameworkElement)
MinHeight

获取或设置 FrameworkElement 的最小高度约束。

(继承自 FrameworkElement)
MinWidth

获取或设置 FrameworkElement 的最小宽度约束。

(继承自 FrameworkElement)
Name

获取或设置对象的标识名称。 当 XAML 处理器从 XAML 标记创建对象树时,运行时代码可以按此名称引用 XAML 声明的对象。

(继承自 FrameworkElement)
Opacity

获取或设置对象的不透明度的程度。

(继承自 UIElement)
OpacityTransition

获取或设置对 Opacity 属性的更改进行动画处理的 ScalarTransition。

(继承自 UIElement)
Padding

获取或设置控件内部的填充边距。

(继承自 Control)
Parent

获取对象树中此 FrameworkElement 的父对象。

(继承自 FrameworkElement)
PlaceholderText

获取或设置控件中显示的文本,直到用户操作或其他操作更改值为止。

PlaceholderTextProperty

标识 PlaceholderText 依赖属性。

PointerCaptures

获取所有捕获的指针的集合,表示为 Pointer 值。

(继承自 UIElement)
PreventKeyboardDisplayOnProgrammaticFocus

获取或设置一个值,该值指示当控件以编程方式接收焦点时是否显示屏幕键盘。

PreventKeyboardDisplayOnProgrammaticFocusProperty

标识 PreventKeyboardDisplayOnProgrammaticFocus 依赖属性。

Projection

获取或设置呈现此元素时要应用的透视投影 (三维效果) 。

(继承自 UIElement)
ProofingMenuFlyout

获取显示校对命令的浮出控件。

ProofingMenuFlyoutProperty

标识 ProofingMenuFlyout 依赖属性。

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

获取或设置对 Rotation 属性的更改进行动画处理的 ScalarTransition。

(继承自 UIElement)
Scale

获取或设置元素的刻度。 相对于元素的 CenterPoint 缩放。 影响元素的呈现位置。

(继承自 UIElement)
ScaleTransition

获取或设置对 Scale 属性的更改进行动画处理的 Vector3Transition。

(继承自 UIElement)
SelectionFlyout

获取或设置使用鼠标、触摸或笔选择文本时显示的浮出控件;如果未显示浮出控件,则为 null

SelectionFlyoutProperty

标识 SelectionFlyout 依赖属性。

SelectionHighlightColor

获取或设置用于突出显示所选文本的画笔。

SelectionHighlightColorProperty

标识 SelectionHighlightColor 依赖属性。

SelectionHighlightColorWhenNotFocused

获取或设置用于在 RichEditBox 没有焦点时突出显示所选文本的画笔。

SelectionHighlightColorWhenNotFocusedProperty

标识 SelectionHighlightColorWhenNotFocused 依赖属性。

Shadow

获取或设置元素投射的阴影效果。

(继承自 UIElement)
Style

获取或设置在布局和呈现期间为此对象应用的实例 Style

(继承自 FrameworkElement)
TabFocusNavigation

获取或设置一个值,该值修改 Tabbing 和 TabIndex 对此控件的工作方式。

(继承自 UIElement)
TabIndex

获取或设置一个值,该值指示当用户使用 Tab 键浏览应用 UI 时元素接收焦点的顺序。

(继承自 Control)
TabNavigation

获取或设置一个值,该值修改 tabbing 和 TabIndex 对此控件的工作方式。

注意

对于Windows 10 创意者更新 (内部版本 10.0.15063) 及更新版本,TabFocusNavigation 属性在 UIElement 基类上可用,以包括选项卡序列中不使用 ControlTemplate 的对象

(继承自 Control)
Tag

获取或设置可用于存储有关此对象的自定义信息的任意对象值。

(继承自 FrameworkElement)
Template

获取或设置控件模板。 控件模板在 UI 中定义控件的视觉外观,并在 XAML 标记中定义。

(继承自 Control)
TextAlignment

获取或设置一个值,该值指示 文本在 RichEditBox 中的对齐方式。

TextAlignmentProperty

标识 TextAlignment 依赖属性。

TextDocument

获取一个 对象,该对象允许访问 RichEditBox 中包含的文本的文本对象模型。

TextReadingOrder

获取或设置一个值,该值指示如何确定 RichEditBox 的阅读顺序。

TextReadingOrderProperty

标识 TextReadingOrder 依赖属性。

TextWrapping

获取或设置一个值,该值指示当文本行超出 RichEditBox 的可用宽度时,文本换行的方式。

TextWrappingProperty

标识 TextWrapping 依赖属性。

Transform3D

获取或设置呈现此元素时要应用的三维转换效果。

(继承自 UIElement)
TransformMatrix

获取或设置要应用于元素的转换矩阵。

(继承自 UIElement)
Transitions

获取或设置应用于 UIElementTransition 样式元素的集合。

(继承自 UIElement)
Translation

获取或设置元素的 x、y 和 z 呈现位置。

(继承自 UIElement)
TranslationTransition

获取或设置对 Translation 属性的更改进行动画处理的 Vector3Transition。

(继承自 UIElement)
Triggers

获取为 FrameworkElement 定义的动画触发器的集合。 不常用。 请参阅“备注”。

(继承自 FrameworkElement)
UIContext

获取 元素的上下文标识符。

(继承自 UIElement)
UseLayoutRounding

获取或设置一个值,该值确定对象及其可视子树的呈现是否应使用使呈现与整个像素对齐的舍入行为。

(继承自 UIElement)
UseSystemFocusVisuals

获取或设置一个值,该值指示控件是使用系统绘制的焦点视觉对象还是控件模板中定义的视觉对象。

(继承自 Control)
VerticalAlignment

获取或设置在父对象(如面板或项控件)中组合时应用于 FrameworkElement 的垂直对齐特征。

(继承自 FrameworkElement)
VerticalContentAlignment

获取或设置控件内容的垂直对齐方式。

(继承自 Control)
Visibility

获取或设置 UIElement 的可见性。 不可见的 UIElement 不会呈现,也不会将其所需大小传达给布局。

(继承自 UIElement)
Width

获取或设置 FrameworkElement 的宽度。

(继承自 FrameworkElement)
XamlRoot

获取或设置 XamlRoot 在其中查看此元素的 。

(继承自 UIElement)
XYFocusDown

获取或设置当用户按下方向键 (方向键) 时获取焦点的对象。

(继承自 Control)
XYFocusDownNavigationStrategy

获取或设置一个值,该值指定用于确定向下导航的目标元素的策略。

(继承自 UIElement)
XYFocusKeyboardNavigation

获取或设置一个值,该值使用键盘方向箭头启用或禁用导航。

(继承自 UIElement)
XYFocusLeft

获取或设置当用户向左按方向键 (方向键时获取焦点的对象) 。

(继承自 Control)
XYFocusLeftNavigationStrategy

获取或设置一个值,该值指定用于确定左侧导航的目标元素的策略。

(继承自 UIElement)
XYFocusRight

获取或设置当用户向右按方向键 (方向键时获取焦点的对象) 。

(继承自 Control)
XYFocusRightNavigationStrategy

获取或设置一个值,该值指定用于确定右侧导航的目标元素的策略。

(继承自 UIElement)
XYFocusUp

获取或设置当用户按下方向键 (方向键) 时获取焦点的对象。

(继承自 Control)
XYFocusUpNavigationStrategy

获取或设置一个值,该值指定用于确定向上导航的目标元素的策略。

(继承自 UIElement)

方法

AddHandler(RoutedEvent, Object, Boolean)

为指定的路由事件添加路由事件处理程序,并将该处理程序添加到当前元素的处理程序集合中。 将 handledEventsToo 指定为 true 以调用提供的处理程序,即使在其他位置处理事件也是如此。

(继承自 UIElement)
ApplyTemplate()

加载相关的控件模板,以便可以引用其部件。

(继承自 Control)
Arrange(Rect)

定位子对象并确定 UIElement 的大小。 为其子元素实现自定义布局的父对象应从其布局重写实现中调用此方法,以形成递归布局更新。

(继承自 UIElement)
ArrangeOverride(Size)

提供布局的“排列”传递的行为。 类可以重写此方法以定义自己的“Arrange”传递行为。

(继承自 FrameworkElement)
CancelDirectManipulations()

取消正在进行的直接操作处理, (系统定义的平移/缩放) 包含当前 UIElement 的任何 ScrollViewer 父级。

(继承自 UIElement)
CapturePointer(Pointer)

将指针捕获设置为 UIElement。 捕获后,只有具有捕获的元素才会触发与指针相关的事件。

(继承自 UIElement)
ClearValue(DependencyProperty)

清除依赖属性的本地值。

(继承自 DependencyObject)
FindName(String)

检索具有指定标识符名称的对象。

(继承自 FrameworkElement)
FindSubElementsForTouchTargeting(Point, Rect)

使 UIElement 子类能够公开有助于解析触摸目标的子元素。

(继承自 UIElement)
Focus(FocusState)

尝试在控件上设置焦点。

(继承自 Control)
GetAnimationBaseValue(DependencyProperty)

返回为依赖属性建立的任何基值,该基值适用于动画未处于活动状态的情况。

(继承自 DependencyObject)
GetBindingExpression(DependencyProperty)

返回 BindingExpression ,它代表指定属性上的绑定。

(继承自 FrameworkElement)
GetChildrenInTabFocusOrder()

允许 UIElement 子类公开参与 Tab 焦点的子元素。

(继承自 UIElement)
GetLinguisticAlternativesAsync()

根据输入法编辑器中提供的拼音字符 (输入法) 异步获取候选字词的列表。

GetTemplateChild(String)

检索实例化 ControlTemplate 可视化树中的命名元素。

(继承自 Control)
GetValue(DependencyProperty)

DependencyObject 返回依赖属性的当前有效值。

(继承自 DependencyObject)
GoToElementStateCore(String, Boolean)

在派生类中实现时,为代码中的控件模板启用可视化树的按状态构造,而不是通过在控件启动时加载所有状态的 XAML。

(继承自 FrameworkElement)
InvalidateArrange()

使 UIElement 的排列状态 (布局) 无效。 无效后, UIElement 将更新其布局,这将异步发生。

(继承自 UIElement)
InvalidateMeasure()

使 UIElement 的度量状态 (布局) 无效。

(继承自 UIElement)
InvalidateViewport()

使用于计算有效视区的 UIElement视区状态失效。

(继承自 FrameworkElement)
Measure(Size)

汇报 UIElementDesiredSize。 通常,为其布局子级实现自定义布局的对象从其自己的 MeasureOverride 实现中调用此方法,以形成递归布局更新。

(继承自 UIElement)
MeasureOverride(Size)

为布局周期的“度量”传递提供行为。 类可以重写此方法以定义其自己的“Measure”传递行为。

(继承自 FrameworkElement)
OnApplyTemplate()

每当应用程序代码或内部进程 (例如重新生成布局传递) 调用 ApplyTemplate 时调用。 简单来说,这意味着在 UI 元素在应用中显示之前调用 方法。 重写此方法以影响类的默认模板后逻辑。

(继承自 FrameworkElement)
OnBringIntoViewRequested(BringIntoViewRequestedEventArgs)

BringIntoViewRequested 事件发生之前调用。

(继承自 UIElement)
OnCharacterReceived(CharacterReceivedRoutedEventArgs)

CharacterReceived 事件发生之前调用。

(继承自 Control)
OnCreateAutomationPeer()

在派生类中实现时,为 Microsoft UI 自动化基础结构返回特定于类的 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)

“保留 ”事件发生之前调用。

(继承自 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)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

注册一个通知函数,用于侦听此 DependencyObject 实例上特定 DependencyProperty 的更改。

(继承自 DependencyObject)
ReleasePointerCapture(Pointer)

释放指针捕获,以便通过此 UIElement 捕获一个特定指针。

(继承自 UIElement)
ReleasePointerCaptures()

释放此元素持有的所有指针捕获。

(继承自 UIElement)
RemoveFocusEngagement()

为游戏板/远程交互) 具有焦点参与 (的控件释放控件边界的焦点。

(继承自 Control)
RemoveHandler(RoutedEvent, Object)

从此 UIElement 中删除指定的路由事件处理程序。 通常,有问题的处理程序是由 AddHandler 添加的。

(继承自 UIElement)
SetBinding(DependencyProperty, BindingBase)

使用提供的绑定对象将绑定附加到 FrameworkElement

(继承自 FrameworkElement)
SetValue(DependencyProperty, Object)

设置 DependencyObject 上依赖属性的本地值。

(继承自 DependencyObject)
StartAnimation(ICompositionAnimationBase)

开始元素上的指定动画。

(继承自 UIElement)
StartBringIntoView()

向 XAML 框架发起请求,以将元素引入其包含的任何可滚动区域内的视图。

(继承自 UIElement)
StartBringIntoView(BringIntoViewOptions)

启动对 XAML 框架的请求,以使用指定的选项将元素引入视图。

(继承自 UIElement)
StartDragAsync(PointerPoint)

启动拖放操作。

(继承自 UIElement)
StopAnimation(ICompositionAnimationBase)

停止元素上的指定动画。

(继承自 UIElement)
TransformToVisual(UIElement)

返回一个转换对象,该对象可用于将 坐标从 UIElement 转换为指定对象。

(继承自 UIElement)
TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

尝试通过搜索 UIElement 的整个可视化树来 (或快捷键) 调用键盘快捷方式。

(继承自 UIElement)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消以前通过调用 RegisterPropertyChangedCallback 注册的更改通知。

(继承自 DependencyObject)
UpdateLayout()

确保针对布局正确更新 UIElement 的子对象的所有位置。

(继承自 UIElement)

事件

AccessKeyDisplayDismissed

在不应再显示访问密钥时发生。

(继承自 UIElement)
AccessKeyDisplayRequested

当用户请求显示访问密钥时发生。

(继承自 UIElement)
AccessKeyInvoked

当用户完成访问密钥序列时发生。

(继承自 UIElement)
ActualThemeChanged

在 ActualTheme 属性值更改时发生。

(继承自 FrameworkElement)
BringIntoViewRequested

在此元素或其后代之一上调用 StartBringIntoView 时发生。

(继承自 UIElement)
CandidateWindowBoundsChanged

当输入法编辑器 (输入法) 窗口打开、更新或关闭时发生。

CharacterReceived

输入队列接收到单个组合字符时发生。

(继承自 UIElement)
ContentLinkChanged

在添加、删除或编辑内容链接时发生。

ContentLinkInvoked

在用户交互激活链接时发生。

ContextCanceled

当上下文输入手势继续转换为操作手势时发生,以通知元素不应打开上下文浮出控件。

(继承自 UIElement)
ContextMenuOpening

当系统处理显示上下文菜单的交互时发生。

ContextRequested

当用户完成上下文输入手势(例如右键单击)时发生。

(继承自 UIElement)
CopyingToClipboard

在复制的文本移动到剪贴板之前发生。

CuttingToClipboard

在剪切文本移动到剪贴板之前发生。

DataContextChanged

FrameworkElement.DataContext 属性的值更改时发生。

(继承自 FrameworkElement)
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

在已构造 FrameworkElement 并将其添加到对象树中并准备好交互时发生。

(继承自 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)
Paste

将文本粘贴到 控件中时发生。

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

在文本选择改变时发生。

SelectionChanging

在文本选择开始更改时发生。

SizeChanged

ActualHeightActualWidth 属性更改 FrameworkElement 上的值时发生。

(继承自 FrameworkElement)
Tapped

在此元素的命中测试区域上发生未经处理的 点击 交互时发生。

(继承自 UIElement)
TextChanged

RichEditBox 中的内容发生更改时发生。

TextChanging

当编辑框中的文本开始更改时,但在呈现之前同步发生。

TextCompositionChanged

通过输入法编辑器撰写的文本 (输入法) 更改时发生。

TextCompositionEnded

当用户停止通过输入法编辑器 (输入法) 撰写文本时发生。

TextCompositionStarted

当用户开始通过输入法编辑器 (输入法) 撰写文本时发生。

Unloaded

当此对象不再连接到main对象树时发生。

(继承自 FrameworkElement)

适用于

另请参阅