private void BtnScene_Click(object sender, RoutedEventArgs e)
 {
     foreach (Button button in _mRefButtons)
     {
         if (button == sender)
         {
             button.Background = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0));
             PlayerDLL.PlayerSelectScene((int)button.DataContext);
         }
         else
         {
             button.Background = new SolidColorBrush(Colors.LightGray);
         }
     }
 }
        private void BtnLoadScene_Click(object sender, RoutedEventArgs e)
        {
            _mButtons.Children.Clear();
            _mRefButtons.Clear();

            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                string path = openFileDialog.FileName;
                if (!string.IsNullOrEmpty(path))
                {
                    try
                    {
                        string contents = File.ReadAllText(path);
                        JArray json     = JArray.Parse(contents);
                        int    i        = 0;
                        foreach (JObject scene in json)
                        {
                            string description = (string)scene.GetValue("description");
                            AddButton(i, description);
                            ++i;
                        }
                    }
                    catch
                    {
                    }

                    int result = PlayerDLL.LoadScene(path);
                    if (result == 0)
                    {
                        PlayerDLL.PlayerSelectScene(0); //reset scene selection
                    }
                    else
                    {
                        Console.Error.WriteLine("Failed to load scene! {0}", path);
                    }
                }
            }
        }