Commits

Mark Heath committed a727d1b

beginning work on config window

Comments (0)

Files changed (5)

MusicRater/ViewModels/ConfigWindowViewModel.cs

 using System;
 using MusicRater.Model;
 
-namespace MusicRater.ViewModels
+namespace MusicRater
 {
     public class ConfigWindowViewModel : ViewModelBase
     {

MusicRater/ViewModels/MainPageViewModel.cs

             this.NextCommand = new RelayCommand(() => Next());
             this.PrevCommand = new RelayCommand(() => Prev());
             this.AnonCommand = new AnonymiseCommand(this.Tracks);
+            this.ConfigCommand = new RelayCommand(() => Config());
 
             //"http://www.archive.org/download/KvrOsc28TyrellN6/KvrOsc28TyrellN6_files.xml"
             //"http://www.archive.org/download/KvrOsc29StringTheory/KvrOsc29StringTheory_files.xml"
         public ICommand PauseCommand { get; private set; }
         public ICommand NextCommand { get; private set; }
         public ICommand PrevCommand { get; private set; }
+        public ICommand ConfigCommand { get; private set; }
         public AnonymiseCommand AnonCommand { get; private set; }
 
         private void ShowError(string message)
         {
             ErrorMessageWindow w = new ErrorMessageWindow();
-            w.DataContext = new ErrorMessageWindowViewModel() { Message = message };            
+            w.DataContext = new ErrorMessageWindowViewModel() { Message = message };
+            w.Show();
+        }
+
+        private void Config()
+        {
+            var w = new ConfigWindow();
+            w.DataContext = new ConfigWindowViewModel(this.contest.Criteria);
             w.Show();
         }
 

MusicRater/Views/ConfigWindow.xaml

-<controls:ChildWindow x:Class="MusicRater.Views.ConfigWindow"
+<controls:ChildWindow x:Class="MusicRater.ConfigWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
            Width="400" Height="300" 
            xmlns:my="clr-namespace:MusicRater.MvvmUtils"
            my:DialogCloser.DialogResult="{Binding DialogResult}"
-           Title="ConfigWindow">
+           Title="Configure MusicRater">
     <controls:ChildWindow.Resources>
         <dummy:DummyConfigWindowViewModel x:Key="viewModel" />
     </controls:ChildWindow.Resources>

MusicRater/Views/ConfigWindow.xaml.cs

 using System.Windows.Media.Animation;
 using System.Windows.Shapes;
 
-namespace MusicRater.Views
+namespace MusicRater
 {
     public partial class ConfigWindow : ChildWindow
     {

MusicRater/Views/ToolbarControl.xaml

                     </Path.RenderTransform>
                 </Path>
             </Button>
+            <Button Style="{StaticResource MarkRoundButton}" Height="32" Margin="2" Width="32" Command="{Binding ConfigCommand}" ToolTipService.ToolTip="Configure">
+                <Path Fill="White" Data="M 0,6 h 6 v 1 h 6 l 2,-.5 l 2,.5 v 1 l -2,.5 l -2,-.5 h -6 v 1 h -6 Z" Width="16" Height="16">
+                    <Path.RenderTransform>
+                        <RotateTransform Angle="-45" CenterX="8" CenterY="8" />
+                    </Path.RenderTransform>
+                    </Path>
+            </Button>
         </StackPanel>
     </Border>
 </UserControl>