public MainWindow() { InitializeComponent(); this.Loaded += OnWindowLoaded; service = MuteButtonService.Instance; service.ButtonStateChanged += OnMuteButtonStateChanged; }
public void Start() { instance = this; buttons = new BleButtonService(); watcher = new BleDeviceWatcher(); watcher.StartWatching(Guid.Parse("f000aa00-0451-4000-b000-000000000000")); _ = FindPairedDevices(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); service = new MuteButtonService(); service.Start(); Install(); //create the notifyicon (it's a resource declared in NotifyIconResources.xaml notifyIcon = (TaskbarIcon)FindResource("NotifyIcon"); if (e.Args.Length > 0 && e.Args[0] == "-background") { return; } ShowMainWindow(); }