Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

BitmapIcon Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents an icon that uses a bitmap as its content.

/// [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 BitmapIcon : IconElement
[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 BitmapIcon : IconElement
Public Class BitmapIconInherits IconElement
<BitmapIcon .../>
Inheritance
Attributes

Windows requirements

RequirementsDescription
Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

Tip

For more info, design guidance, and code examples, seeCommand bar.

TheWinUI 2 Gallery app includes interactive examples of most WinUI 2 controls, features, and functionality. Get the app from theMicrosoft Store or get the source code onGitHub.

This example shows anAppBarButton with a BitmapIcon. TheUriSource specifies an image that's included in the app package.

<AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">    <AppBarButton.Icon>        <BitmapIcon UriSource="ms-appx:///Assets/globe.png"/>    </AppBarButton.Icon></AppBarButton>

Remarks

Note

BitmapIcon is typically used to provide the icon for an AppBarButton, and the remarks in this section assume this usage. However, it can be used anywhere a UIElement can be used. The remarks apply to all usages.

To use a BitmapIcon as theIcon for anAppBarButton, you specify the URI of an image file.

The file that you use should be a solid image on a transparent background. The bitmap image as retrieved from theUriSource location is expected to be a true bitmap that has transparent pixels and non-transparent pixels. The recommended format is PNG. Other file-format image sources will load apparently without error but result in a solid block of the foreground color inside theAppBarButton. This behavior can be ignored by setting theShowAsMonochrome property to false.

All color info is stripped from the bitmap when the BitmapIcon is rendered. The remaining non-transparent colors are combined to produce an image that's entirely the foreground color as set by theForeground property (this typically comes from styles or templates, such as the default template resolving to a theme resource). You can override this behavior by setting theShowAsMonochrome property.

The value of theForeground property must be aSolidColorBrush. After the Foreground's Color property is read, changes to it are ignored. To change the color you must change the value of the Foreground property itself to a new SolidColorBrush.

Note

You can set theForeground property on theAppBarButton or on the BitmapIcon. If you set theForeground on theAppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in theAppBarButton template, likeMouseOver. If you set theForeground on the BitmapIcon, the color is applied to all visual states.

The default font size for an AppBarButton Icon is 20px.

You typically specify aUriSource value that references a bitmap that you've included as part of the app, as a resource or otherwise within the app package. For more info on thems-appx: scheme and other URI schemes that you can use to reference resources in your app, seeUri schemes.

Version history

Windows versionSDK versionValue added
170315063ShowAsMonochrome

Constructors

NameDescription
BitmapIcon()

Initializes a new instance of theBitmapIcon class.

Properties

NameDescription
AccessKey

Gets or sets the access key (mnemonic) for this element.

(Inherited fromUIElement)
AccessKeyScopeOwner

Gets or sets a source element that provides the access key scope for this element, even if it's not in the visual tree of the source element.

(Inherited fromUIElement)
ActualHeight

Gets the rendered height of aFrameworkElement. See Remarks.

(Inherited fromFrameworkElement)
ActualOffset

Gets the position of this UIElement, relative to its parent, computed during the arrange pass of the layout process.

(Inherited fromUIElement)
ActualSize

Gets the size that this UIElement computed during the arrange pass of the layout process.

(Inherited fromUIElement)
ActualTheme

Gets the UI theme that is currently used by the element, which might be different than theRequestedTheme.

(Inherited fromFrameworkElement)
ActualWidth

Gets the rendered width of aFrameworkElement. See Remarks.

(Inherited fromFrameworkElement)
AllowDrop

Gets or sets a value that determines whether thisUIElement can be a drop target for purposes of drag-and-drop operations.

(Inherited fromUIElement)
AllowFocusOnInteraction

Gets or sets a value that indicates whether the element automatically gets focus when the user interacts with it.

(Inherited fromFrameworkElement)
AllowFocusWhenDisabled

Gets or sets whether a disabled control can receive focus.

(Inherited fromFrameworkElement)
BaseUri

Gets a Uniform Resource Identifier (URI) that represents the base Uniform Resource Identifier (URI) for an XAML-constructed object at XAML load time. This property is useful for Uniform Resource Identifier (URI) resolution at run time.

(Inherited fromFrameworkElement)
CacheMode

Gets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible.

(Inherited fromUIElement)
CanBeScrollAnchor

Gets or sets a value that indicates whether theUIElement can be a candidate for scroll anchoring.

(Inherited fromUIElement)
CanDrag

Gets or sets a value that indicates whether the element can be dragged as data in a drag-and-drop operation.

(Inherited fromUIElement)
CenterPoint

Gets or sets the center point of the element, which is the point about which rotation or scaling occurs. Affects the rendering position of the element.

(Inherited fromUIElement)
Clip

Gets or sets theRectangleGeometry used to define the outline of the contents of aUIElement.

(Inherited fromUIElement)
CompositeMode

Gets or sets a property that declares alternate composition and blending modes for the element in its parent layout and window. This is relevant for elements that are involved in a mixed XAML / Microsoft DirectX UI.

(Inherited fromUIElement)
ContextFlyout

Gets or sets the flyout associated with this element.

(Inherited fromUIElement)
DataContext

Gets or sets the data context for aFrameworkElement. A common use of a data context is when aFrameworkElement uses the{Binding} markup extension and participates in data binding.

(Inherited fromFrameworkElement)
DesiredSize

Gets the size that thisUIElement computed during the measure pass of the layout process.

(Inherited fromUIElement)
Dispatcher

Gets theCoreDispatcher that this object is associated with. TheCoreDispatcher represents a facility that can access theDependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited fromDependencyObject)
ExitDisplayModeOnAccessKeyInvoked

Gets or sets a value that specifies whether the access key display is dismissed when an access key is invoked.

(Inherited fromUIElement)
FlowDirection

Gets or sets the direction in which text and other UI elements flow within any parent element that controls their layout. This property can be set to eitherLeftToRight orRightToLeft. Setting FlowDirection toRightToLeft on any element sets the alignment to the right, the reading order to right-to-left and the layout of the control to flow from right to left.

(Inherited fromFrameworkElement)
FocusVisualMargin

Gets or sets the outer margin of the focus visual for aFrameworkElement.

(Inherited fromFrameworkElement)
FocusVisualPrimaryBrush

Gets or sets the brush used to draw the outer border of aHighVisibility orReveal focus visual for aFrameworkElement.

(Inherited fromFrameworkElement)
FocusVisualPrimaryThickness

Gets or sets the thickness of the outer border of aHighVisibility orReveal focus visual for aFrameworkElement.

(Inherited fromFrameworkElement)
FocusVisualSecondaryBrush

Gets or sets the brush used to draw the inner border of aHighVisibility orReveal focus visual for aFrameworkElement.

(Inherited fromFrameworkElement)
FocusVisualSecondaryThickness

Gets or sets the thickness of the inner border of aHighVisibility orReveal focus visual for aFrameworkElement.

(Inherited fromFrameworkElement)
Foreground

Gets or sets a brush that describes the foreground color.

(Inherited fromIconElement)
Height

Gets or sets the suggested height of aFrameworkElement.

(Inherited fromFrameworkElement)
HighContrastAdjustment

Gets or sets a value that indicates whether the framework automatically adjusts the element's visual properties when high contrast themes are enabled.

(Inherited fromUIElement)
HorizontalAlignment

Gets or sets the horizontal alignment characteristics that are applied to aFrameworkElement when it is composed in a layout parent, such as a panel or items control.

(Inherited fromFrameworkElement)
IsAccessKeyScope

Gets or sets a value that indicates whether an element defines its own access key scope.

(Inherited fromUIElement)
IsDoubleTapEnabled

Gets or sets a value that determines whether theDoubleTapped event can originate from that element.

(Inherited fromUIElement)
IsHitTestVisible

Gets or sets whether the contained area of thisUIElement can return true values for hit testing.

(Inherited fromUIElement)
IsHoldingEnabled

Gets or sets a value that determines whether theHolding event can originate from that element.

(Inherited fromUIElement)
IsLoaded

Gets a value that indicates whether the element has been added to the element tree and is ready for interaction.

(Inherited fromFrameworkElement)
IsRightTapEnabled

Gets or sets a value that determines whether theRightTapped event can originate from that element.

(Inherited fromUIElement)
IsTapEnabled

Gets or sets a value that determines whether theTapped event can originate from that element.

(Inherited fromUIElement)
KeyboardAcceleratorPlacementMode

Gets or sets a value that indicates whether the controltooltip displays the key combination for its associated keyboard accelerator.

(Inherited fromUIElement)
KeyboardAcceleratorPlacementTarget

Gets or sets a value that indicates the controltooltip that displays the accelerator key combination.

(Inherited fromUIElement)
KeyboardAccelerators

Gets the collection of key combinations that invoke an action using the keyboard.

Accelerators are typically assigned to buttons or menu items.

Example of a menu showing keyboard accelerators for various menu items
Example of a menu showing keyboard accelerators for various menu items

(Inherited fromUIElement)
KeyTipHorizontalOffset

Gets or sets a value that indicates how far left or right the keytip is placed in relation to the UIElement.

(Inherited fromUIElement)
KeyTipPlacementMode

Gets or sets a value that indicates where the access key keytip is placed in relation to the boundary of the UIElement.

(Inherited fromUIElement)
KeyTipTarget

Gets or sets a value that indicates the element targeted by the access key keytip.

(Inherited fromUIElement)
KeyTipVerticalOffset

Gets or sets a value that indicates how far up or down the keytip is placed in relation to the UI element.

(Inherited fromUIElement)
Language

Gets or sets localization/globalization language information that applies to aFrameworkElement, and also to all child elements of the currentFrameworkElement in the object representation and in UI.

(Inherited fromFrameworkElement)
Lights

Gets the collection ofXamlLight objects attached to this element.

(Inherited fromUIElement)
ManipulationMode

Gets or sets theManipulationModes value used forUIElement behavior and interaction with gestures. Setting this value enables handling the manipulation events from this element in app code.

(Inherited fromUIElement)
Margin

Gets or sets the outer margin of aFrameworkElement.

(Inherited fromFrameworkElement)
MaxHeight

Gets or sets the maximum height constraint of aFrameworkElement.

(Inherited fromFrameworkElement)
MaxWidth

Gets or sets the maximum width constraint of aFrameworkElement.

(Inherited fromFrameworkElement)
MinHeight

Gets or sets the minimum height constraint of aFrameworkElement.

(Inherited fromFrameworkElement)
MinWidth

Gets or sets the minimum width constraint of aFrameworkElement.

(Inherited fromFrameworkElement)
Name

Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name.

(Inherited fromFrameworkElement)
Opacity

Gets or sets the degree of the object's opacity.

(Inherited fromUIElement)
OpacityTransition

Gets or sets the ScalarTransition that animates changes to the Opacity property.

(Inherited fromUIElement)
Parent

Gets the parent object of thisFrameworkElement in the object tree.

(Inherited fromFrameworkElement)
PointerCaptures

Gets the set of all captured pointers, represented asPointer values.

(Inherited fromUIElement)
Projection

Gets or sets the perspective projection (3-D effect) to apply when rendering this element.

(Inherited fromUIElement)
RenderSize

Gets the final render size of aUIElement. Use is not recommended, see Remarks.

(Inherited fromUIElement)
RenderTransform

Gets or sets transform information that affects the rendering position of aUIElement.

(Inherited fromUIElement)
RenderTransformOrigin

Gets or sets the origin point of any possible render transform declared byRenderTransform, relative to the bounds of theUIElement.

(Inherited fromUIElement)
RequestedTheme

Gets or sets the UI theme that is used by theUIElement (and its child elements) for resource determination. The UI theme you specify with RequestedTheme can override the app-levelRequestedTheme.

(Inherited fromFrameworkElement)
Resources

Gets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of aframeworkElement.Resources property element, through XAML implicit collection syntax.

(Inherited fromFrameworkElement)
Rotation

Gets or sets the angle of clockwise rotation, in degrees. Rotates relative to the RotationAxis and the CenterPoint. Affects the rendering position of the element.

(Inherited fromUIElement)
RotationAxis

Gets or sets the axis to rotate the element around.

(Inherited fromUIElement)
RotationTransition

Gets or sets the ScalarTransition that animates changes to the Rotation property.

(Inherited fromUIElement)
Scale

Gets or sets the scale of the element. Scales relative to the element's CenterPoint. Affects the rendering position of the element.

(Inherited fromUIElement)
ScaleTransition

Gets or sets the Vector3Transition that animates changes to the Scale property.

(Inherited fromUIElement)
Shadow

Gets or sets the shadow effect cast by the element.

(Inherited fromUIElement)
ShowAsMonochrome

Gets or sets a value that indicates whether the bitmap is shown in a single color.

ShowAsMonochromeProperty

Identifies theShowAsMonochrome dependency property.

Style

Gets or sets an instanceStyle that is applied for this object during layout and rendering.

(Inherited fromFrameworkElement)
TabFocusNavigation

Gets or sets a value that modifies how tabbing andTabIndex work for this control.

(Inherited fromUIElement)
Tag

Gets or sets an arbitrary object value that can be used to store custom information about this object.

(Inherited fromFrameworkElement)
Transform3D

Gets or sets the 3-D transform effect to apply when rendering this element.

(Inherited fromUIElement)
TransformMatrix

Gets or sets the transformation matrix to apply to the element.

(Inherited fromUIElement)
Transitions

Gets or sets the collection ofTransition style elements that apply to aUIElement.

(Inherited fromUIElement)
Translation

Gets or sets the x, y, and z rendering position of the element.

(Inherited fromUIElement)
TranslationTransition

Gets or sets the Vector3Transition that animates changes to the Translation property.

(Inherited fromUIElement)
Triggers

Gets the collection of triggers for animations that are defined for aFrameworkElement. Not commonly used. See Remarks.

(Inherited fromFrameworkElement)
UIContext

Gets the context identifier for the element.

(Inherited fromUIElement)
UriSource

Gets or sets the Uniform Resource Identifier (URI) of the bitmap to use as the icon content.

UriSourceProperty

Identifies theUriSource dependency property.

UseLayoutRounding

Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels.

(Inherited fromUIElement)
VerticalAlignment

Gets or sets the vertical alignment characteristics that are applied to aFrameworkElement when it is composed in a parent object such as a panel or items control.

(Inherited fromFrameworkElement)
Visibility

Gets or sets the visibility of aUIElement. AUIElement that is not visible is not rendered and does not communicate its desired size to layout.

(Inherited fromUIElement)
Width

Gets or sets the width of aFrameworkElement.

(Inherited fromFrameworkElement)
XamlRoot

Gets or sets theXamlRoot in which this element is being viewed.

(Inherited fromUIElement)
XYFocusDownNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a down navigation.

(Inherited fromUIElement)
XYFocusKeyboardNavigation

Gets or sets a value that enables or disables navigation using the keyboard directional arrows.

(Inherited fromUIElement)
XYFocusLeftNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a left navigation.

(Inherited fromUIElement)
XYFocusRightNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a right navigation.

(Inherited fromUIElement)
XYFocusUpNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of an up navigation.

(Inherited fromUIElement)

Methods

NameDescription
AddHandler(RoutedEvent, Object, Boolean)

Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. SpecifyhandledEventsToo astrue to have the provided handler be invoked even if the event is handled elsewhere.

(Inherited fromUIElement)
Arrange(Rect)

Positions child objects and determines a size for aUIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update.

(Inherited fromUIElement)
ArrangeOverride(Size)

Provides the behavior for the "Arrange" pass of layout. Classes can override this method to define their own "Arrange" pass behavior.

(Inherited fromFrameworkElement)
CancelDirectManipulations()

Cancels ongoing direct manipulation processing (system-defined panning/zooming) on anyScrollViewer parent that contains the currentUIElement.

(Inherited fromUIElement)
CapturePointer(Pointer)

Sets pointer capture to aUIElement. Once captured, only the element that has capture will fire pointer-related events.

(Inherited fromUIElement)
ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited fromDependencyObject)
FindName(String)

Retrieves an object that has the specified identifier name.

(Inherited fromFrameworkElement)
FindSubElementsForTouchTargeting(Point, Rect)

Enables aUIElement subclass to expose child elements that assist with resolving touch targeting.

(Inherited fromUIElement)
GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited fromDependencyObject)
GetBindingExpression(DependencyProperty)

Returns theBindingExpression that represents the binding on the specified property.

(Inherited fromFrameworkElement)
GetChildrenInTabFocusOrder()

Enables aUIElement subclass to expose child elements that take part in Tab focus.

(Inherited fromUIElement)
GetValue(DependencyProperty)

Returns the current effective value of a dependency property from aDependencyObject.

(Inherited fromDependencyObject)
GoToElementStateCore(String, Boolean)

When implemented in a derived class, enables per-state construction of a visual tree for a control template in code, rather than by loading XAML for all states at control startup.

(Inherited fromFrameworkElement)
InvalidateArrange()

Invalidates the arrange state (layout) for aUIElement. After the invalidation, theUIElement will have its layout updated, which will occur asynchronously.

(Inherited fromUIElement)
InvalidateMeasure()

Invalidates the measurement state (layout) for aUIElement.

(Inherited fromUIElement)
InvalidateViewport()

Invalidates the viewport state for aUIElement that is used to calculate theeffective viewport.

(Inherited fromFrameworkElement)
Measure(Size)

Updates theDesiredSize of aUIElement. Typically, objects that implement custom layout for their layout children call this method from their ownMeasureOverride implementations to form a recursive layout update.

(Inherited fromUIElement)
MeasureOverride(Size)

Provides the behavior for the "Measure" pass of the layout cycle. Classes can override this method to define their own "Measure" pass behavior.

(Inherited fromFrameworkElement)
OnApplyTemplate()

Invoked whenever application code or internal processes (such as a rebuilding layout pass) callApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.

(Inherited fromFrameworkElement)
OnBringIntoViewRequested(BringIntoViewRequestedEventArgs)

Called before theBringIntoViewRequested event occurs.

(Inherited fromUIElement)
OnCreateAutomationPeer()

When implemented in a derived class, returns class-specificAutomationPeer implementations for the Microsoft UI Automation infrastructure.

(Inherited fromUIElement)
OnDisconnectVisualChildren()

Override this method to implement how layout and logic should behave when items are removed from a class-specific content or children property.

(Inherited fromUIElement)
OnKeyboardAcceleratorInvoked(KeyboardAcceleratorInvokedEventArgs)

Called when akeyboard shortcut (or accelerator) is processed in your app. Override this method to handle how your app responds when a keyboard accelerator is invoked.

(Inherited fromUIElement)
OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

Called just before akeyboard shortcut (or accelerator) is processed in your app. Invoked whenever application code or internal processes callProcessKeyboardAccelerators. Override this method to influence the default accelerator handling.

(Inherited fromUIElement)
PopulatePropertyInfo(String, AnimationPropertyInfo)

Defines a property that can be animated.

(Inherited fromUIElement)
PopulatePropertyInfoOverride(String, AnimationPropertyInfo)

When overridden in a derived class, defines a property that can be animated.

(Inherited fromUIElement)
ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited fromDependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specificDependencyProperty on thisDependencyObject instance.

(Inherited fromDependencyObject)
ReleasePointerCapture(Pointer)

Releases pointer captures for capture of one specific pointer by thisUIElement.

(Inherited fromUIElement)
ReleasePointerCaptures()

Releases all pointer captures held by this element.

(Inherited fromUIElement)
RemoveHandler(RoutedEvent, Object)

Removes the specified routed event handler from thisUIElement. Typically the handler in question was added byAddHandler.

(Inherited fromUIElement)
SetBinding(DependencyProperty, BindingBase)

Attaches a binding to aFrameworkElement, using the provided binding object.

(Inherited fromFrameworkElement)
SetValue(DependencyProperty, Object)

Sets the local value of a dependency property on aDependencyObject.

(Inherited fromDependencyObject)
StartAnimation(ICompositionAnimationBase)

Begins the specified animation on the element.

(Inherited fromUIElement)
StartBringIntoView()

Initiates a request to the XAML framework to bring the element into view within any scrollable regions it is contained within.

(Inherited fromUIElement)
StartBringIntoView(BringIntoViewOptions)

Initiates a request to the XAML framework to bring the element into view using the specified options.

(Inherited fromUIElement)
StartDragAsync(PointerPoint)

Initiates a drag-and-drop operation.

(Inherited fromUIElement)
StopAnimation(ICompositionAnimationBase)

Stops the specified animation on the element.

(Inherited fromUIElement)
TransformToVisual(UIElement)

Returns a transform object that can be used to transform coordinates from theUIElement to the specified object.

(Inherited fromUIElement)
TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

Attempts to invoke akeyboard shortcut (or accelerator) by searching the entire visual tree of the UIElement for the shortcut.

(Inherited fromUIElement)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

Cancels a change notification that was previously registered by callingRegisterPropertyChangedCallback.

(Inherited fromDependencyObject)
UpdateLayout()

Ensures that all positions of child objects of aUIElement are properly updated for layout.

(Inherited fromUIElement)

Events

NameDescription
AccessKeyDisplayDismissed

Occurs when access keys should no longer be displayed.

(Inherited fromUIElement)
AccessKeyDisplayRequested

Occurs when the user requests that access keys be displayed.

(Inherited fromUIElement)
AccessKeyInvoked

Occurs when a user completes an access key sequence.

(Inherited fromUIElement)
ActualThemeChanged

Occurs when the ActualTheme property value has changed.

(Inherited fromFrameworkElement)
BringIntoViewRequested

Occurs whenStartBringIntoView is called on this element or one of its descendants.

(Inherited fromUIElement)
CharacterReceived

Occurs when a single, composed character is received by the input queue.

(Inherited fromUIElement)
ContextCanceled

Occurs when a context input gesture continues into a manipulation gesture, to notify the element that the context flyout should not be opened.

(Inherited fromUIElement)
ContextRequested

Occurs when the user has completed a context input gesture, such as a right-click.

(Inherited fromUIElement)
DataContextChanged

Occurs when the value of theFrameworkElement.DataContext property changes.

(Inherited fromFrameworkElement)
DoubleTapped

Occurs when an otherwise unhandledDoubleTap interaction occurs over the hit test area of this element.

(Inherited fromUIElement)
DragEnter

Occurs when the input system reports an underlying drag event with this element as the target.

(Inherited fromUIElement)
DragLeave

Occurs when the input system reports an underlying drag event with this element as the origin.

(Inherited fromUIElement)
DragOver

Occurs when the input system reports an underlying drag event with this element as the potential drop target.

(Inherited fromUIElement)
DragStarting

Occurs when a drag operation is initiated.

(Inherited fromUIElement)
Drop

Occurs when the input system reports an underlying drop event with this element as the drop target.

(Inherited fromUIElement)
DropCompleted

Occurs when a drag-and-drop operation with this element as the source is ended.

(Inherited fromUIElement)
EffectiveViewportChanged

Occurs when theFrameworkElement'seffective viewport changes.

(Inherited fromFrameworkElement)
GettingFocus

Occurs before aUIElement receives focus. This event is raised synchronously to ensure focus isn't moved while the event is bubbling.

(Inherited fromUIElement)
GotFocus

Occurs when aUIElement receives focus. This event is raised asynchronously, so focus can move again before bubbling is complete.

(Inherited fromUIElement)
Holding

Occurs when an otherwise unhandledHold interaction occurs over the hit test area of this element.

(Inherited fromUIElement)
KeyDown

Occurs when a keyboard key is pressed while theUIElement has focus.

(Inherited fromUIElement)
KeyUp

Occurs when a keyboard key is released while theUIElement has focus.

(Inherited fromUIElement)
LayoutUpdated

Occurs when the layout of the visual tree changes, due to layout-relevant properties changing value or some other action that refreshes the layout.

(Inherited fromFrameworkElement)
Loaded

Occurs when aFrameworkElement has been constructed and added to the object tree, and is ready for interaction.

(Inherited fromFrameworkElement)
Loading

Occurs when aFrameworkElement begins to load.

(Inherited fromFrameworkElement)
LosingFocus

Occurs before aUIElement loses focus. This event is raised synchronously to ensure focus isn't moved while the event is bubbling.

(Inherited fromUIElement)
LostFocus

Occurs when aUIElement loses focus. This event is raised asynchronously, so focus can move again before bubbling is complete.

(Inherited fromUIElement)
ManipulationCompleted

Occurs when a manipulation on theUIElement is complete.

(Inherited fromUIElement)
ManipulationDelta

Occurs when the input device changes position during a manipulation.

(Inherited fromUIElement)
ManipulationInertiaStarting

Occurs when the input device loses contact with theUIElement object during a manipulation and inertia begins.

(Inherited fromUIElement)
ManipulationStarted

Occurs when an input device begins a manipulation on theUIElement.

(Inherited fromUIElement)
ManipulationStarting

Occurs when the manipulation processor is first created.

(Inherited fromUIElement)
NoFocusCandidateFound

Occurs when a user attempts to move focus (via tab or directional arrows), but focus doesn't move because no focus candidate is found in the direction of movement.

(Inherited fromUIElement)
PointerCanceled

Occurs when a pointer that made contact abnormally loses contact.

(Inherited fromUIElement)
PointerCaptureLost

Occurs when pointer capture previously held by this element moves to another element or elsewhere.

(Inherited fromUIElement)
PointerEntered

Occurs when a pointer enters the hit test area of this element.

(Inherited fromUIElement)
PointerExited

Occurs when a pointer leaves the hit test area of this element.

(Inherited fromUIElement)
PointerMoved

Occurs when a pointer moves while the pointer remains within the hit test area of this element.

(Inherited fromUIElement)
PointerPressed

Occurs when the pointer device initiates aPress action within this element.

(Inherited fromUIElement)
PointerReleased

Occurs when the pointer device that previously initiated aPress action is released, while within this element. Note that the end of aPress action is not guaranteed to fire a PointerReleased event; other events may fire instead. For more info, see Remarks.

(Inherited fromUIElement)
PointerWheelChanged

Occurs when the delta value of a pointer wheel changes.

(Inherited fromUIElement)
PreviewKeyDown

Occurs when a keyboard key is pressed while theUIElement has focus.

(Inherited fromUIElement)
PreviewKeyUp

Occurs when a keyboard key is released while theUIElement has focus.

(Inherited fromUIElement)
ProcessKeyboardAccelerators

Occurs when akeyboard shortcut (or accelerator) is pressed.

(Inherited fromUIElement)
RightTapped

Occurs when a right-tap input stimulus happens while the pointer is over the element.

(Inherited fromUIElement)
SizeChanged

Occurs when either theActualHeight or theActualWidth property changes value on aFrameworkElement.

(Inherited fromFrameworkElement)
Tapped

Occurs when an otherwise unhandledTap interaction occurs over the hit test area of this element.

(Inherited fromUIElement)
Unloaded

Occurs when this object is no longer connected to the main object tree.

(Inherited fromFrameworkElement)

Applies to

See also


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?