IconElement IconElement IconElement Class

Represents the base class for an icon UI element.

Syntax

Declaration

public class IconElementpublic class IconElementPublic Class IconElement

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Remarks

IconElement derived classes

IconElement is the parent class for these classes:

Properties summary

Gets or sets a brush that describes the foreground color.

Identifies the Foreground dependency property.

Properties

  • Foreground
    Foreground
    Foreground
    Foreground

    Gets or sets a brush that describes the foreground color.

    public Brush Foreground { get; set; }public Brush Foreground { get; set; }Public ReadWrite Property Foreground As Brush
    <icon Foreground="{StaticResource resourceName}"/>
    
    

    Property Value

    • The brush that paints the foreground of the control. The default is null, (a null brush) which is evaluated as Transparent for rendering. However, this value is typically set by a default system resource at runtime, which is tied to the active theme and other settings.

    Remarks

    You can set the Foreground property on the AppBarButton or on an IconElement derived icon. If you set the Foreground on the AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the AppBarButton template, like MouseOver. If you set the Foreground on the IconElement derived icon, the color is applied to all visual states.

    The only valid Brush type for the Foreground value is SolidColorBrush. If you attempt to use a brush that's not declaring a solid color, the value is ignored at run time and replaced with a SolidColorBrush that is white or black, depending on the current theme.

    Foreground replaces the color information from a UriSource source file. Any non-transparent pixel in the source image is replaced with the Foreground color.

    Examples

    This example shows an AppBarButton that uses a SymbolIcon with its Foreground set to "Green".

    <AppBarButton Label="Accept">
        <AppBarButton.Icon>
            <SymbolIcon Symbol="Accept" Foreground="Green"/>
        </AppBarButton.Icon>
    </AppBarButton>
    
  • ForegroundProperty
    ForegroundProperty
    ForegroundProperty
    ForegroundProperty

    Identifies the Foreground dependency property.

    public static DependencyProperty ForegroundProperty { get; }public static DependencyProperty ForegroundProperty { get; }Public Static ReadOnly Property ForegroundProperty As DependencyProperty

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll