handycontrol NotifyIcon ContextMenu

  <hc:NotifyIcon Text="xxxx程序"  Visibility="Collapsed"  Name="notifyIcon" 
         Icon="/Assets/Ico/title.ico" Click="NotifyIcon_Click" MouseRightButtonDown="notifyIcon_MouseRightButtonDown" >
      <hc:NotifyIcon.ContextMenu>
          <ContextMenu>
              <MenuItem Command="hc:ControlCommands.PushMainWindow2Top" Header="显示" />
              <MenuItem Command="hc:ControlCommands.ShutdownApp" Header="退出" />
          </ContextMenu>
      </hc:NotifyIcon.ContextMenu>
      <hc:Interaction.Triggers>
          <hc:EventTrigger EventName="Click">
              <hc:EventToCommand Command="hc:ControlCommands.PushMainWindow2Top"/>
          </hc:EventTrigger>
          <hc:EventTrigger EventName="MouseDoubleClick">
              <hc:EventToCommand Command="hc:ControlCommands.PushMainWindow2Top"/>
          </hc:EventTrigger>
      </hc:Interaction.Triggers>
  </hc:NotifyIcon>
posted @ 2024-11-15 17:50  Hey,Coder!  阅读(3)  评论(0编辑  收藏  举报