private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     UserStateVisualizer.StartPoint();
 }
        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.C)
            {
                CameraViewer.TopMost         = true;
                CameraViewer.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                CameraViewer.WindowState     = System.Windows.Forms.FormWindowState.Maximized;
                CameraViewer.Show();
            }

            if (e.Key == Key.F)
            {
                int index = ListOATeSettings.IndexOf(_OATeSettings);
                if ((index + 1) < ListOATeSettings.Count)
                {
                    _OATeSettings = ListOATeSettings[index + 1];
                }
                else
                {
                    _OATeSettings = ListOATeSettings[0];
                }

                //ImageSource source = new BitmapImage(new Uri(_OATeSettings.Barra, UriKind.RelativeOrAbsolute));
                //border_barra.Background = new ImageBrush(source);
                _MediaViewer._OATeSettings = _OATeSettings;
                foreach (var item in _OATeSettings.MediaFiles)
                {
                    _MediaViewer.AddElement(item);
                }

                UserStateVisualizer._OATeSettings = this._OATeSettings;
                UserStateVisualizer.StartPoint();
            }

            //if ((e.KeyboardDevice.IsKeyDown(Key.LeftAlt) || e.KeyboardDevice.IsKeyDown(Key.RightAlt)) && e.SystemKey == Key.Escape)
            //    Application.Current.Shutdown(0);

            if ((e.KeyboardDevice.IsKeyDown(Key.LeftAlt) || e.KeyboardDevice.IsKeyDown(Key.RightAlt)) && e.SystemKey == Key.L)
            {
                OATeSettings oATeSettings;
                if (OATeSettings.TryLoadSettingsWithOpenFileDialog("OATeSettings.xml", out oATeSettings))
                {
                    UserStateVisualizer.ValueReached -= _MediaViewer.UserStateVisualizer_ValueReached;
                    _OATeSettings = oATeSettings;

                    _MediaViewer.Close();

                    _MediaViewer        = new MediaViewer(_OATeSettings);
                    _MediaViewer.Width  = SystemParameters.PrimaryScreenWidth;
                    _MediaViewer.Height = SystemParameters.PrimaryScreenHeight - this.Height;
                    _MediaViewer.Left   = 0;
                    _MediaViewer.Top    = 0;
                    _MediaViewer.Show();
                    UserStateVisualizer.ValueReached += _MediaViewer.UserStateVisualizer_ValueReached;

                    ImageSource source = new BitmapImage(new Uri(_OATeSettings.Barra, UriKind.RelativeOrAbsolute));
                    border_barra.Background           = new ImageBrush(source);
                    UserStateVisualizer._OATeSettings = _OATeSettings;
                    foreach (var item in _OATeSettings.MediaFiles)
                    {
                        _MediaViewer.AddElement(item);
                    }
                }
            }
        }