public TrayIconViewModel(PreferencesWindowController preferencesWindowController, ApplicationInfo applicationInfo) { ShowPreferencesCommand = new RelayCommand(() => preferencesWindowController.ShowDialog()); ExitApplicationCommand = new RelayCommand(() => Application.Current.Shutdown()); _lazyIcon = new Lazy <ImageSource>(() => new BitmapImage(new Uri("pack://application:,,,/Luxa4Slack.Tray;component/Icon.ico"))); ToolTip = applicationInfo.DisplayName; }
void ShowPreferencesWindow() { if (preferencesWindowController == null) { preferencesWindowController = new PreferencesWindowController(); } preferencesWindowController.Window.MakeKeyAndOrderFront(this); }
void ShowPreferences(NSObject sender) { if (preferencesWindowController == null) { preferencesWindowController = NSStoryboard .FromName("Main", NSBundle.MainBundle) .InstantiateController <PreferencesWindowController> (); } preferencesWindowController.Window.MakeKeyAndOrderFront(sender); }
public ApplicationStartup( IOptionsMonitor <ApplicationOptions> options, TrayIconController trayIconController, PreferencesWindowController preferencesWindowController, ApplicationInfo applicationInfo, Lazy <Dispatcher> dispatcher, ILogger <ApplicationStartup> logger, ILuxa4SlackFactory luxa4SlackFactory, ILuxaforClient luxaforClient, IConfigurationRoot configurationRoot) { _options = options; _trayIconController = trayIconController; _preferencesWindowController = preferencesWindowController; _applicationInfo = applicationInfo; _dispatcher = dispatcher; _logger = logger; _luxa4SlackFactory = luxa4SlackFactory; _luxaforClient = luxaforClient; _configurationRoot = configurationRoot; _preferencesWindowController.OpenedChanged += OnPreferencesWindowWindowOpenedChanged; _luxaforClient.LuxaforFailed += OnLuxaforFailed; }