Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += OnWindowLoaded;

            service = MuteButtonService.Instance;
            service.ButtonStateChanged += OnMuteButtonStateChanged;
        }
Exemplo n.º 2
0
 public void Start()
 {
     instance = this;
     buttons  = new BleButtonService();
     watcher  = new BleDeviceWatcher();
     watcher.StartWatching(Guid.Parse("f000aa00-0451-4000-b000-000000000000"));
     _ = FindPairedDevices();
 }
Exemplo n.º 3
0
        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();
        }