public DapploTrayIconViewModel(
     IMainContextMenuTranslations contextMenuTranslations,
     ITrayIconManager trayIconManager,
     [MetadataFilter("Menu", "contextmenu")] IEnumerable <Lazy <IMenuItem> > contextMenuItems = null
     ) : base(trayIconManager)
 {
     _contextMenuTranslations = contextMenuTranslations;
     _contextMenuItems        = contextMenuItems;
 }
示例#2
0
        public TitleMenuItem(IMainContextMenuTranslations contextMenuTranslations)
        {
            // automatically update the DisplayName
            contextMenuTranslations.CreateDisplayNameBinding(this, nameof(IMainContextMenuTranslations.Title));
            Id    = "A_Title";
            Style = MenuItemStyles.Title;

            Icon = new PackIconMaterial
            {
                Kind = PackIconMaterialKind.Clipboard
            };
            this.ApplyIconForegroundColor(Brushes.SaddleBrown);
        }
示例#3
0
 public ExitMenuItem(
     IMainContextMenuTranslations contextMenuTranslations
     )
 {
     // automatically update the DisplayName
     contextMenuTranslations.CreateDisplayNameBinding(this, nameof(IMainContextMenuTranslations.Exit));
     Id   = "Z_Exit";
     Icon = new PackIconMaterial
     {
         Kind = PackIconMaterialKind.Close,
         HorizontalAlignment        = HorizontalAlignment.Stretch,
         VerticalAlignment          = VerticalAlignment.Stretch,
         HorizontalContentAlignment = HorizontalAlignment.Stretch,
         VerticalContentAlignment   = VerticalAlignment.Stretch
     };
     ClickAction = clickedItem =>
     {
         Dapplication.Current.Shutdown();
     };
     this.ApplyIconForegroundColor(Brushes.DarkRed);
 }