Back to Devexpress

NotifyIconService.Icon Property

wpf-devexpress-dot-xpf-dot-core-dot-notifyiconservice-a7ee3889.md

latest2.9 KB
Original Source

NotifyIconService.Icon Property

Gets or sets a value specifying the tray icon’s image. This is a dependency property.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public ImageSource Icon { get; set; }
vb
Public Property Icon As ImageSource

Property Value

TypeDescription
ImageSource

A value specifying the tray icon’s image.

|

Remarks

You can display the .ico , .png or .svg files as the tray icon’s image.

The following code snippet describes how to specify a tray’s image:

csharp
<dxmvvm:Interaction.Behaviors>
  <dx:NotifyIconService LeftClickCommand="{Binding DoIconLeftActionCommand}" Icon="demoicon.ico" Tooltip="{Binding ElementName=textBox, Path=Text}">
    <dx:NotifyIconService.States>
      <dx:NotifyIconState Name="ico" Icon="statistics.ico"/>
      <dx:NotifyIconState Name="png" Icon="{dx:DXImage Image=Apply_16x16.png}"/>
      <dx:NotifyIconState Name="svg" Icon="{dx:SvgImageSource Uri=add.svg}"/>
    </dx:NotifyIconService.States>
    <dxb:PopupMenu>
      <dxb:BarButtonItem Content="Ico" Command="{Binding IcoCommand}" />
      <dxb:BarButtonItem Content="Png" Command="{Binding PngCommand}" />
      <dxb:BarButtonItem Content="Svg" Command="{Binding SvgCommand}" />
    </dxb:PopupMenu>
  </dx:NotifyIconService>
</dxmvvm:Interaction.Behaviors>
vb
_ < dxmvvm
Interaction.Behaviors > _ < dx
Dim LeftClickCommand As NotifyIconService = "{Binding DoIconLeftActionCommand}"
Icon = "demoicon.ico"
Tooltip = "{Binding ElementName=textBox, Path=Text}" > _ < dx
NotifyIconService.States > _ < dx
Dim Name As NotifyIconState = "ico"
Icon = "statistics.ico" / _ > _ < dx
Dim Name As NotifyIconState = "png"
Icon = "{dx:DXImage Image=Apply_16x16.png}" / _ > _ < dx
Dim Name As NotifyIconState = "svg"
Icon = "{dx:SvgImageSource Uri=add.svg}" / _ > _ < _ / dx
NotifyIconService.States > _ < dxb
PopupMenu > _ < dxb
Dim Content As BarButtonItem = "Ico"
Command = "{Binding IcoCommand}" / _ > _ < dxb
Dim Content As BarButtonItem = "Png"
Command = "{Binding PngCommand}" / _ > _ < dxb
Dim Content As BarButtonItem = "Svg"
Command = "{Binding SvgCommand}" / _ > _ < _ / dxb
PopupMenu > _ < _ / dx
NotifyIconService > _ < _ / dxmvvm
Interaction.Behaviors > _

See Also

NotifyIconService Class

NotifyIconService Members

DevExpress.Xpf.Core Namespace