Mark Heath avatar Mark Heath committed b6893ba

Added an icon ready for an open dialog to choose contest and add new ones

Comments (0)

Files changed (6)

MusicRater/MusicRater.csproj

     <Compile Include="DummyViewModels\DummyMainWindowViewModel.cs" />
     <Compile Include="DummyViewModels\DummyPositionControlViewModel.cs" />
     <Compile Include="ViewModels\ConfigWindowViewModel.cs" />
+    <Compile Include="ViewModels\OpenContestWindowViewModel.cs" />
     <Compile Include="Views\ConfigWindow.xaml.cs">
       <DependentUpon>ConfigWindow.xaml</DependentUpon>
     </Compile>
     </Compile>
     <Compile Include="ViewModels\MainPageViewModel.cs" />
     <Compile Include="ModalDialogService.cs" />
+    <Compile Include="Views\OpenContestWindow.xaml.cs">
+      <DependentUpon>OpenContestWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PositionControl.xaml.cs">
       <DependentUpon>PositionControl.xaml</DependentUpon>
     </Compile>
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\OpenContestWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PositionControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

MusicRater/ViewModels/MainPageViewModel.cs

             this.PrevCommand = new RelayCommand(() => Prev());
             this.AnonCommand = new AnonymiseCommand(this.Tracks);
             this.ConfigCommand = new RelayCommand(() => Config());
+            this.OpenCommand = new RelayCommand(() => Open());
 
             //"http://www.archive.org/download/KvrOsc28TyrellN6/KvrOsc28TyrellN6_files.xml"
             //"http://www.archive.org/download/KvrOsc29StringTheory/KvrOsc29StringTheory_files.xml"
         public ICommand NextCommand { get; private set; }
         public ICommand PrevCommand { get; private set; }
         public ICommand ConfigCommand { get; private set; }
+        public ICommand OpenCommand { get; private set; }
         public AnonymiseCommand AnonCommand { get; private set; }
 
         private void ShowError(string message)
             w.Show();
         }
 
+        private void Open()
+        {
+            var w = new OpenContestWindow();
+            w.DataContext = new OpenContestWindowViewModel();
+            w.Show();
+        }
+
         public TrackViewModel SelectedTrack
         {
             get

MusicRater/ViewModels/OpenContestWindowViewModel.cs

+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+using GalaSoft.MvvmLight;
+
+namespace MusicRater
+{
+    public class OpenContestWindowViewModel : ViewModelBase
+    {
+
+    }
+}

MusicRater/Views/OpenContestWindow.xaml

+<controls:ChildWindow x:Class="MusicRater.OpenContestWindow"
+           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" 
+           Title="OpenContestWindow">
+    <Grid x:Name="LayoutRoot" Margin="2">
+        <Grid.RowDefinitions>
+            <RowDefinition />
+            <RowDefinition Height="Auto" />
+        </Grid.RowDefinitions>
+
+        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
+        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
+    </Grid>
+</controls:ChildWindow>

MusicRater/Views/OpenContestWindow.xaml.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace MusicRater
+{
+    public partial class OpenContestWindow : ChildWindow
+    {
+        public OpenContestWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void OKButton_Click(object sender, RoutedEventArgs e)
+        {
+            this.DialogResult = true;
+        }
+
+        private void CancelButton_Click(object sender, RoutedEventArgs e)
+        {
+            this.DialogResult = false;
+        }
+    }
+}
+

MusicRater/Views/ToolbarControl.xaml

                     <Path.RenderTransform>
                         <RotateTransform Angle="-45" CenterX="8" CenterY="8" />
                     </Path.RenderTransform>
-                    </Path>
+                </Path>
             </Button>
+            <Button Style="{StaticResource MarkRoundButton}" Height="32" Margin="2" Width="32" Command="{Binding OpenCommand}" ToolTipService.ToolTip="Open">
+                <Path Fill="White" Data="F1 M 0,4 h 4 v -1 h -4 Z M 0,2 h 4 l -2,-2  Z" Stretch="UniformToFill" Width="16" Height="16" />
+            </Button>
+
         </StackPanel>
     </Border>
 </UserControl>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.