Permalink
Browse files

add DirectoryFormats, AudioFileFormats to New Profile viewmodel

  • Loading branch information...
1 parent e26f9e0 commit 762c7f4a44c3c533c849e5069cd8542f236f5324 @judwhite committed Sep 6, 2011
@@ -53,6 +53,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="About\ComponentInformation.cs" />
+ <Compile Include="Profile\NewProfile\FormatItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@@ -0,0 +1,19 @@
+using CDTag.Common;
+
+namespace CDTag.Model.Profile.NewProfile
+{
+ public class FormatItem : ModelBase<FormatItem>
+ {
+ public string FormatString
+ {
+ get { return Get<string>("FormatString"); }
+ set { Set("FormatString", value); }
+ }
+
+ public string Result
+ {
+ get { return Get<string>("Result"); }
+ set { Set("Result", value); }
+ }
+ }
+}
@@ -55,23 +55,23 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="0.05*" />
</Grid.ColumnDefinitions>
-
+
<TextBlock Grid.Row="0" Grid.Column="1" Text="Directory" Margin="0,2" />
- <DataGrid Grid.Row="1" Grid.Column="1" AutoGenerateColumns="False" Height="150" Margin="0,2">
-
+ <DataGrid Grid.Row="1" Grid.Column="1" AutoGenerateColumns="False" Height="150" Margin="0,2" ItemsSource="{Binding DirectoryFormats, Mode=OneWay}">
+
</DataGrid>
-
+
<TextBlock Grid.Row="2" Grid.Column="1" Text="Audio files" Margin="0,8,0,2" />
- <DataGrid Grid.Row="3" Grid.Column="1" AutoGenerateColumns="False" Height="120" Margin="0,2">
+ <DataGrid Grid.Row="3" Grid.Column="1" AutoGenerateColumns="False" Height="120" Margin="0,2" ItemsSource="{Binding AudioFileFormats, Mode=OneWay}">
</DataGrid>
<CheckBox Grid.Row="4" Grid.Column="1" VerticalContentAlignment="Center" Content="Use _underscores instead of spaces" IsChecked="{Binding UseUnderscores, Mode=TwoWay}" Margin="0,8,0,2" HorizontalAlignment="Left" />
<CheckBox Grid.Row="5" Grid.Column="1" VerticalContentAlignment="Center" Content="Only _allow characters A-Z a-z 0-9 - _ . ()" IsChecked="{Binding UseStandardCharactersOnly, Mode=TwoWay}" Margin="0,2" HorizontalAlignment="Left" />
<CheckBox Grid.Row="6" Grid.Column="1" VerticalContentAlignment="Center" Content="Convert _regional characters to A-Z" IsChecked="{Binding UseLatinCharactersOnly, Mode=TwoWay}" Margin="0,2" HorizontalAlignment="Left" />
</Grid>
-
+
</Grid>
-
+
<Path Grid.Row="1" Data="M0,0 L1,0" Stroke="#CCCCCC" Stretch="Fill" Margin="0,8" />
<Grid Grid.Row="2" Grid.IsSharedSizeScope="True">
@@ -81,9 +81,9 @@
<ColumnDefinition Width="Auto" SharedSizeGroup="BottomButtons" MinWidth="80" />
<ColumnDefinition Width="Auto" SharedSizeGroup="BottomButtons" MinWidth="80" />
</Grid.ColumnDefinitions>
-
+
<Button Grid.Column="0" Content="_Cancel" IsCancel="True" Padding="7,2" Margin="0,0,8,0" />
-
+
<Button Grid.Column="2" Content="_Previous" Padding="7,2" Margin="8,0,0,0" Command="{Binding PreviousCommand}" />
<Button Grid.Column="3" Content="_Next" Padding="7,2" Margin="8,0,0,0" Command="{Binding NextCommand}" IsDefault="True" />
</Grid>
@@ -1,5 +1,7 @@
-using System.Windows.Input;
+using System.Collections.ObjectModel;
+using System.Windows.Input;
using CDTag.Common;
+using CDTag.Model.Profile.NewProfile;
namespace CDTag.ViewModel.Profile.NewProfile
{
@@ -16,5 +18,7 @@ public interface INewProfileViewModel : IViewModelBase
bool UseStandardCharactersOnly { get; set; }
bool UseLatinCharactersOnly { get; set; }
bool IsProfileNameFocused { get; set; }
+ ObservableCollection<FormatItem> DirectoryFormats { get; }
+ ObservableCollection<FormatItem> AudioFileFormats { get; }
}
}
@@ -1,8 +1,10 @@
using System;
+using System.Collections.ObjectModel;
using System.IO;
using System.Windows;
using System.Windows.Input;
using CDTag.Common;
+using CDTag.Model.Profile.NewProfile;
using CDTag.View;
using CDTag.ViewModel.Events;
@@ -12,6 +14,8 @@ public class NewProfileViewModel : ViewModelBase<NewProfileViewModel>, INewProfi
{
private readonly DelegateCommand _nextCommand;
private readonly DelegateCommand _previousCommand;
+ private readonly ObservableCollection<FormatItem> _directoryFormats;
+ private readonly ObservableCollection<FormatItem> _audioFileFormats;
private bool _storedCreateSampleNFO = true;
private bool _storedHasExistingNFO;
@@ -25,6 +29,15 @@ public NewProfileViewModel(IEventAggregator eventAggregator)
_previousCommand = new DelegateCommand(Previous, () => PageIndex > 0);
EnhancedPropertyChanged += NewProfileViewModel_EnhancedPropertyChanged;
+
+ _directoryFormats = new ObservableCollection<FormatItem>
+ {
+ new FormatItem { FormatString = "<Artist> - <Album>" },
+ new FormatItem { FormatString = "<Artist> - <Album> - <Year>" },
+ new FormatItem { FormatString = "<Artist> - <Album> (<Year>)" },
+ new FormatItem { FormatString = "<Artist> - <Year> - <Album>" },
+ new FormatItem { FormatString = "<Artist> - (<Year>) - <Album>" },
+ };
}
private void NewProfileViewModel_EnhancedPropertyChanged(object sender, EnhancedPropertyChangedEventArgs<NewProfileViewModel> e)
@@ -222,5 +235,15 @@ public bool IsProfileNameFocused
Set("IsProfileNameFocused", value);
}
}
+
+ public ObservableCollection<FormatItem> DirectoryFormats
+ {
+ get { return _directoryFormats; }
+ }
+
+ public ObservableCollection<FormatItem> AudioFileFormats
+ {
+ get { return _audioFileFormats; }
+ }
}
}

0 comments on commit 762c7f4

Please sign in to comment.