public MainWindow()
        {
            InitializeComponent();

            _razer = Provider.Razer;
            ActivateApp();
            Provider.CurrentWindow = this;

            DataContext = new MainWindowMessageViewModel
            {
                Message = "Unknown initialization error",
                MessageDetails = "Unknown error."
            };

            // Try to init Steam
            try
            {
                var steam = Provider.Steam;
                if (steam.LocalUser == null)
                    return;

                Application.Current.MainWindow = new FriendsWindow();
                Close();
                Application.Current.MainWindow.Show();
            }
            catch (SteamException ex)
            {
                var context = new MainWindowMessageViewModel
                {
                    Message = "Steam failed to initialize properly, is Steam running?",
                    MessageDetails = String.Format("Please close app and launch it after Steam has been started.\n\nError detail:\n{0}: {1}", ex.GetType(), ex.Message)
                };
                DataContext = context;
            }
        }
        public GamesWindow()
        {
            InitializeComponent();

            _overlayHelper = new OverlayHelper(NewMessageOverlay, NewMessageOverlayLabel);

            Provider.Steam.MessageReceived += SteamOnMessageReceived;

            _razer = Provider.Razer;
            ActivateApp();
            Provider.CurrentWindow = this;
        }
        public MainWindow()
        {
            InitializeComponent();
            try
            {
                _manager = RazerManager.Instance;
                _manager.AppEvent += OnAppEvent;

                createiTunes(true);

                setPlayPauseButton();
                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK6, dkBack, @"Default\Images\back.png", @"Default\Images\back_pressed.png", true);
                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK8, dkNext, @"Default\Images\forward.png", @"Default\Images\forward_pressed.png", true);
                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK9, dkStop, @"Default\Images\stop.png", @"Default\Images\stop_pressed.png", true);

                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK1, dkiTunes, @"Default\Images\iTunes.png", @"Default\Images\iTunes.png", true);

                updateVolumeLabel();
                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK5, dkQuieter, @"Default\Images\quiet.png", @"Default\Images\quiet_pressed.png", true);
                RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK10, dkLouder, @"Default\Images\louder.png", @"Default\Images\louder_pressed.png", true);

                //RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK4, dkQuieter, @"Default\Images\quiet.png", @"Default\Images\quiet_pressed.png", true);
                //RazerManager.Instance.EnableDynamicKey(RazerAPI.DynamicKeyType.DK5, dkLouder, @"Default\Images\louder.png", @"Default\Images\louder_pressed.png", true);

                //setMuteButton(true);

                setup();
                displayTrack();

                _manager.Touchpad.SetWindow(this, Touchpad.RenderMethod.Polling);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                releaseiTunes();
                closeApp();
            }
        }
        public ChatWindow(Friend friend)
        {
            InitializeComponent();

            _friend = friend;

            _overlayHelper = new OverlayHelper(NewMessageOverlay, NewMessageOverlayLabel);

            TitleLabel.Content = String.Format(TitleFormat, _friend.Name);

            _friend.TypingMessageReceived += FriendOnTypingMessageReceived;
            _friend.ChatMessageReceived += FriendOnChatMessageReceived;

            Provider.Steam.MessageReceived += SteamOnMessageReceived;

            var viewModel = FriendViewModel.GetViewModel(_friend);
            DataContext = viewModel;
            ((INotifyCollectionChanged) viewModel.Messages.Messages).CollectionChanged += MessagesCollectionChanged;

            _razer = Provider.Razer;
            ActivateApp();
            Provider.CurrentWindow = this;
        }