From 862b812711df7165c72f23a6e9e55149b995a390 Mon Sep 17 00:00:00 2001 From: brentedwards Date: Mon, 13 Dec 2010 22:00:58 -0600 Subject: [PATCH] Adding solution for client application. --- .../BrentEdwards.MVVM.Movies.Core.csproj | 90 + .../ComponentContainer.cs | 37 + .../Conversion/BoolToVisibilityConverter.cs | 33 + .../Conversion/RatingTemplateSelector.cs | 32 + .../Messaging/CloseViewMessage.cs | 17 + .../Messaging/SearchMessage.cs | 24 + .../ModalDialogs/Dialog.cs | 14 + .../ModalDialogs/IMessageShower.cs | 13 + .../ModalDialogs/MessageShower.cs | 20 + .../Models/Genres.cs | 17 + .../Models/ModelBase.cs | 26 + BrentEdwards.MVVM.Movies.Core/Models/Movie.cs | 86 + .../Models/Ratings.cs | 15 + .../Navigation/MoviesViewTargets.cs | 18 + .../Properties/AssemblyInfo.cs | 36 + .../Repositories/IMovieRepository.cs | 13 + .../Repositories/MovieRepository.cs | 67 + .../ViewModels/AdvancedSearchViewModel.cs | 77 + .../ViewModels/CoreViewModelBase.cs | 16 + .../ViewModels/DetailViewModel.cs | 96 + .../ViewModels/ITitledViewModel.cs | 12 + .../ViewModels/MasterViewModel.cs | 61 + .../ViewModels/QuickSearchViewModel.cs | 38 + BrentEdwards.MVVM.Movies.sln | 66 + BrentEdwards.MVVM.Movies/App.xaml | 8 + BrentEdwards.MVVM.Movies/App.xaml.cs | 16 + .../BrentEdwards.MVVM.Movies.csproj | 154 + .../Configuration/ContainerConfiguration.cs | 84 + .../Images/.svn/all-wcprops | 17 + BrentEdwards.MVVM.Movies/Images/.svn/entries | 96 + .../Images/.svn/prop-base/g.png.svn-base | 5 + .../Images/.svn/prop-base/r.png.svn-base | 5 + .../Images/.svn/text-base/g.png.svn-base | Bin 0 -> 1662 bytes .../Images/.svn/text-base/r.png.svn-base | Bin 0 -> 1501 bytes BrentEdwards.MVVM.Movies/Images/g.png | Bin 0 -> 1662 bytes BrentEdwards.MVVM.Movies/Images/r.png | Bin 0 -> 1501 bytes BrentEdwards.MVVM.Movies/MainWindow.xaml | 14 + BrentEdwards.MVVM.Movies/MainWindow.xaml.cs | 27 + .../Properties/AssemblyInfo.cs | 55 + .../Properties/Resources.Designer.cs | 63 + .../Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + .../Views/AdvancedSearch.xaml | 23 + .../Views/AdvancedSearch.xaml.cs | 27 + BrentEdwards.MVVM.Movies/Views/Detail.xaml | 162 + BrentEdwards.MVVM.Movies/Views/Detail.xaml.cs | 27 + BrentEdwards.MVVM.Movies/Views/Master.xaml | 89 + BrentEdwards.MVVM.Movies/Views/Master.xaml.cs | 27 + .../Views/QuickSearch.xaml | 23 + .../Views/QuickSearch.xaml.cs | 27 + BrentEdwards.MVVM.Movies/app.config | 3 + BrentEdwards.MVVM.Test/ActionCommandTests.cs | 125 + BrentEdwards.MVVM/ActionCommand.cs | 116 + BrentEdwards.MVVM/Navigation/ViewTargets.cs | 3 - lib/castle/Castle.Core.dll | Bin 0 -> 287744 bytes lib/castle/Castle.Core.xml | 4937 ++++++++++ lib/castle/Castle.Windsor.dll | Bin 0 -> 315392 bytes lib/castle/Castle.Windsor.xml | 8635 +++++++++++++++++ 59 files changed, 15839 insertions(+), 3 deletions(-) create mode 100644 BrentEdwards.MVVM.Movies.Core/BrentEdwards.MVVM.Movies.Core.csproj create mode 100644 BrentEdwards.MVVM.Movies.Core/ComponentContainer.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Conversion/BoolToVisibilityConverter.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Conversion/RatingTemplateSelector.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Messaging/CloseViewMessage.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Messaging/SearchMessage.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ModalDialogs/Dialog.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ModalDialogs/IMessageShower.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ModalDialogs/MessageShower.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Models/Genres.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Models/ModelBase.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Models/Movie.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Models/Ratings.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Navigation/MoviesViewTargets.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Properties/AssemblyInfo.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Repositories/IMovieRepository.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/Repositories/MovieRepository.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/AdvancedSearchViewModel.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/CoreViewModelBase.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/DetailViewModel.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/ITitledViewModel.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/MasterViewModel.cs create mode 100644 BrentEdwards.MVVM.Movies.Core/ViewModels/QuickSearchViewModel.cs create mode 100644 BrentEdwards.MVVM.Movies.sln create mode 100644 BrentEdwards.MVVM.Movies/App.xaml create mode 100644 BrentEdwards.MVVM.Movies/App.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/BrentEdwards.MVVM.Movies.csproj create mode 100644 BrentEdwards.MVVM.Movies/Configuration/ContainerConfiguration.cs create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/all-wcprops create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/entries create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/prop-base/g.png.svn-base create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/prop-base/r.png.svn-base create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/text-base/g.png.svn-base create mode 100644 BrentEdwards.MVVM.Movies/Images/.svn/text-base/r.png.svn-base create mode 100644 BrentEdwards.MVVM.Movies/Images/g.png create mode 100644 BrentEdwards.MVVM.Movies/Images/r.png create mode 100644 BrentEdwards.MVVM.Movies/MainWindow.xaml create mode 100644 BrentEdwards.MVVM.Movies/MainWindow.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/Properties/AssemblyInfo.cs create mode 100644 BrentEdwards.MVVM.Movies/Properties/Resources.Designer.cs create mode 100644 BrentEdwards.MVVM.Movies/Properties/Resources.resx create mode 100644 BrentEdwards.MVVM.Movies/Properties/Settings.Designer.cs create mode 100644 BrentEdwards.MVVM.Movies/Properties/Settings.settings create mode 100644 BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml create mode 100644 BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/Views/Detail.xaml create mode 100644 BrentEdwards.MVVM.Movies/Views/Detail.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/Views/Master.xaml create mode 100644 BrentEdwards.MVVM.Movies/Views/Master.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/Views/QuickSearch.xaml create mode 100644 BrentEdwards.MVVM.Movies/Views/QuickSearch.xaml.cs create mode 100644 BrentEdwards.MVVM.Movies/app.config create mode 100644 BrentEdwards.MVVM.Test/ActionCommandTests.cs create mode 100644 BrentEdwards.MVVM/ActionCommand.cs create mode 100644 lib/castle/Castle.Core.dll create mode 100644 lib/castle/Castle.Core.xml create mode 100644 lib/castle/Castle.Windsor.dll create mode 100644 lib/castle/Castle.Windsor.xml diff --git a/BrentEdwards.MVVM.Movies.Core/BrentEdwards.MVVM.Movies.Core.csproj b/BrentEdwards.MVVM.Movies.Core/BrentEdwards.MVVM.Movies.Core.csproj new file mode 100644 index 0000000..1f313ab --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/BrentEdwards.MVVM.Movies.Core.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D10AC932-FFB4-4118-AE31-C628AA42BA91} + Library + Properties + BrentEdwards.MVVM.Movies.Core + BrentEdwards.MVVM.Movies.Core + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\lib\castle\Castle.Core.dll + + + ..\lib\castle\Castle.Windsor.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {C590ED20-159A-48DF-9D83-1E4E9153DDFE} + BrentEdwards.MVVM + + + + + \ No newline at end of file diff --git a/BrentEdwards.MVVM.Movies.Core/ComponentContainer.cs b/BrentEdwards.MVVM.Movies.Core/ComponentContainer.cs new file mode 100644 index 0000000..d3ddb43 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ComponentContainer.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Castle.Windsor; +using System.Reflection; +using Castle.MicroKernel.ComponentActivator; + +namespace BrentEdwards.MVVM.Movies.Core +{ + public class ComponentContainer + { + public static IWindsorContainer Container { get; set; } + + public static void BuildUp(object target) + { + var type = target.GetType(); + foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (property.CanWrite && Container.Kernel.HasComponent(property.PropertyType)) + { + var value = Container.Resolve(property.PropertyType); + try + { + property.SetValue(target, value, null); + } + catch (Exception ex) + { + var message = string.Format("Error setting property {0} on type {1}, See inner exception for more information.", property.Name, type.FullName); + throw new ComponentActivatorException(message, ex); + } + } + } + + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Conversion/BoolToVisibilityConverter.cs b/BrentEdwards.MVVM.Movies.Core/Conversion/BoolToVisibilityConverter.cs new file mode 100644 index 0000000..88f10a7 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Conversion/BoolToVisibilityConverter.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Data; +using System.Windows; + +namespace BrentEdwards.MVVM.Movies.Core.Conversion +{ + public sealed class BoolToVisibilityConverter : IValueConverter + { + #region IValueConverter Members + + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + var visibility = Visibility.Visible; + + if (value is Boolean) + { + visibility = (Boolean)value ? Visibility.Visible : Visibility.Collapsed; + } + + return visibility; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + + #endregion + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Conversion/RatingTemplateSelector.cs b/BrentEdwards.MVVM.Movies.Core/Conversion/RatingTemplateSelector.cs new file mode 100644 index 0000000..93c9a88 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Conversion/RatingTemplateSelector.cs @@ -0,0 +1,32 @@ +using System.Windows; +using System.Windows.Controls; +using BrentEdwards.MVVM.Movies.Core.Models; + +namespace BrentEdwards.MVVM.Movies.Core.Conversion +{ + public sealed class RatingTemplateSelector : DataTemplateSelector + { + public DataTemplate GTemplate { get; set; } + public DataTemplate RTemplate { get; set; } + + public override DataTemplate SelectTemplate(object item, DependencyObject container) + { + DataTemplate template = null; + if (item is Ratings) + { + switch ((Ratings)item) + { + case Ratings.G: + template = GTemplate; + break; + + case Ratings.R: + template = RTemplate; + break; + } + } + + return template; + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Messaging/CloseViewMessage.cs b/BrentEdwards.MVVM.Movies.Core/Messaging/CloseViewMessage.cs new file mode 100644 index 0000000..922dd6c --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Messaging/CloseViewMessage.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BrentEdwards.MVVM.Movies.Core.Messaging +{ + public sealed class CloseViewMessage + { + public CloseViewMessage(String viewName) + { + ViewName = viewName; + } + + public String ViewName { get; private set; } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Messaging/SearchMessage.cs b/BrentEdwards.MVVM.Movies.Core/Messaging/SearchMessage.cs new file mode 100644 index 0000000..332eeaa --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Messaging/SearchMessage.cs @@ -0,0 +1,24 @@ +using System; +using BrentEdwards.MVVM.Movies.Core.Models; + +namespace BrentEdwards.MVVM.Movies.Core.Messaging +{ + public sealed class SearchMessage + { + public SearchMessage(String keywords) + { + Keywords = keywords; + } + + public SearchMessage(String keywords, Genres? genre, Ratings? rating) + : this(keywords) + { + Genre = genre; + Rating = rating; + } + + public String Keywords { get; private set; } + public Genres? Genre { get; private set; } + public Ratings? Rating { get; private set; } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ModalDialogs/Dialog.cs b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/Dialog.cs new file mode 100644 index 0000000..2a41072 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/Dialog.cs @@ -0,0 +1,14 @@ +using System; +using System.Windows; + +namespace BrentEdwards.MVVM.Movies.Core.ModalDialogs +{ + public sealed class Dialog + { + public static MessageBoxResult ShowMessage(String message, String caption, MessageBoxButton button) + { + var messageShower = ComponentContainer.Container.Resolve(); + return messageShower.Show(message, caption, button); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ModalDialogs/IMessageShower.cs b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/IMessageShower.cs new file mode 100644 index 0000000..4a04e3d --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/IMessageShower.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; + +namespace BrentEdwards.MVVM.Movies.Core.ModalDialogs +{ + public interface IMessageShower + { + MessageBoxResult Show(String message, String caption, MessageBoxButton button); + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ModalDialogs/MessageShower.cs b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/MessageShower.cs new file mode 100644 index 0000000..efc415c --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ModalDialogs/MessageShower.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; + +namespace BrentEdwards.MVVM.Movies.Core.ModalDialogs +{ + public sealed class MessageShower : IMessageShower + { + #region IMessageShower Members + + public MessageBoxResult Show(String message, String caption, MessageBoxButton button) + { + return MessageBox.Show(message, caption, button); + } + + #endregion + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Models/Genres.cs b/BrentEdwards.MVVM.Movies.Core/Models/Genres.cs new file mode 100644 index 0000000..d383f73 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Models/Genres.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BrentEdwards.MVVM.Movies.Core.Models +{ + public enum Genres + { + Action, + Comedy, + Drama, + Family, + Fantasy, + Horror + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Models/ModelBase.cs b/BrentEdwards.MVVM.Movies.Core/Models/ModelBase.cs new file mode 100644 index 0000000..fab745b --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Models/ModelBase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel; + +namespace BrentEdwards.MVVM.Movies.Core.Models +{ + public abstract class ModelBase : INotifyPropertyChanged + { + #region INotifyPropertyChanged Members + + public event PropertyChangedEventHandler PropertyChanged; + + #endregion + + protected void NotifyPropertyChanged(String propertyName) + { + if (PropertyChanged != null) + { + var args = new PropertyChangedEventArgs(propertyName); + PropertyChanged(this, args); + } + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Models/Movie.cs b/BrentEdwards.MVVM.Movies.Core/Models/Movie.cs new file mode 100644 index 0000000..713261d --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Models/Movie.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel; + +namespace BrentEdwards.MVVM.Movies.Core.Models +{ + public sealed class Movie : ModelBase, IDataErrorInfo + { + public Movie() + { + Id = -1; + } + + public Movie(int id, String name, Genres genre, Ratings rating) + { + Id = id; + Name = name; + Genre = genre; + Rating = rating; + } + + public int Id { get; set; } + + private String _Name; + public String Name + { + get { return _Name; } + set + { + _Name = value; + NotifyPropertyChanged("Name"); + } + } + + private Genres _Genre; + public Genres Genre + { + get { return _Genre; } + set + { + _Genre = value; + NotifyPropertyChanged("Genre"); + } + } + + private Ratings _Rating; + public Ratings Rating + { + get { return _Rating; } + set + { + _Rating = value; + NotifyPropertyChanged("Rating"); + } + } + + #region IDataErrorInfo Members + + public string Error + { + get { throw new NotImplementedException(); } + } + + public string this[string name] + { + get + { + String result = null; + + if (name == "Name") + { + if (String.IsNullOrEmpty(Name)) + { + result = "The movie must have a Name."; + } + } + + return result; + } + } + + #endregion + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Models/Ratings.cs b/BrentEdwards.MVVM.Movies.Core/Models/Ratings.cs new file mode 100644 index 0000000..7860193 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Models/Ratings.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BrentEdwards.MVVM.Movies.Core.Models +{ + public enum Ratings + { + G, + PG, + PG13, + R + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Navigation/MoviesViewTargets.cs b/BrentEdwards.MVVM.Movies.Core/Navigation/MoviesViewTargets.cs new file mode 100644 index 0000000..34f6f51 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Navigation/MoviesViewTargets.cs @@ -0,0 +1,18 @@ +using System; + +namespace BrentEdwards.MVVM.Movies.Core.Navigation +{ + public sealed class MoviesViewTargets : ViewTargets + { + protected internal MoviesViewTargets() + { + } + + protected MoviesViewTargets(int value) + : base(value) + { + } + + public static ViewTargets Detail = 2; + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Properties/AssemblyInfo.cs b/BrentEdwards.MVVM.Movies.Core/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ab491b2 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("BrentEdwards.MVVM.Movies.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("BrentEdwards.MVVM.Movies.Core")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2e933c27-3217-4add-80a5-f15630be0d4a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BrentEdwards.MVVM.Movies.Core/Repositories/IMovieRepository.cs b/BrentEdwards.MVVM.Movies.Core/Repositories/IMovieRepository.cs new file mode 100644 index 0000000..21200bf --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Repositories/IMovieRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using BrentEdwards.MVVM.Movies.Core.Models; + +namespace BrentEdwards.MVVM.Movies.Core.Repositories +{ + public interface IMovieRepository + { + IList Load(); + IList Search(String keywords, Genres? genre, Ratings? rating); + Movie Save(Movie movie); + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/Repositories/MovieRepository.cs b/BrentEdwards.MVVM.Movies.Core/Repositories/MovieRepository.cs new file mode 100644 index 0000000..45e8469 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/Repositories/MovieRepository.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using BrentEdwards.MVVM.Movies.Core.Models; + +namespace BrentEdwards.MVVM.Movies.Core.Repositories +{ + public sealed class MovieRepository : IMovieRepository + { + private IList _Movies; + + public MovieRepository() + { + _Movies = GetMovies(); + } + + #region IMovieRepository Members + + public IList Load() + { + return _Movies; + } + + public IList Search(String keywords, Genres? genre, Ratings? rating) + { + var movies = _Movies.Where(m => m.Name.ToLower().Contains(keywords.ToLower())); + + if (genre.HasValue) + { + movies = movies.Where(m => m.Genre == genre.Value); + } + + if (rating.HasValue) + { + movies = movies.Where(m => m.Rating == rating.Value); + } + + return movies.ToList(); + } + + public Movie Save(Movie movie) + { + if (movie.Id == -1) + { + var newest = _Movies.OrderByDescending(m => m.Id).First(); + movie.Id = newest.Id + 1; + _Movies.Add(movie); + } + + return movie; + } + + #endregion + + private IList GetMovies() + { + _Movies = new List(); + _Movies.Add(new Movie(1, "Cars", Genres.Family, Ratings.G)); + _Movies.Add(new Movie(2, "How to Train Your Dragon", Genres.Family, Ratings.PG)); + _Movies.Add(new Movie(3, "Avatar", Genres.Fantasy, Ratings.PG13)); + _Movies.Add(new Movie(4, "The Hangover", Genres.Comedy, Ratings.R)); + + + return _Movies; + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/AdvancedSearchViewModel.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/AdvancedSearchViewModel.cs new file mode 100644 index 0000000..ee67e87 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/AdvancedSearchViewModel.cs @@ -0,0 +1,77 @@ +using System; +using System.Windows.Input; +using BrentEdwards.MVVM.Messaging; +using BrentEdwards.MVVM.Movies.Core.Messaging; +using BrentEdwards.MVVM.Movies.Core.Models; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public sealed class AdvancedSearchViewModel : CoreViewModelBase + { + public AdvancedSearchViewModel() + : base() + { + SearchCommand = new ActionCommand(Search); + } + + public ICommand SearchCommand { get; private set; } + + public IMessageBus MessageBus { get; set; } + + private String _Keywords; + public String Keywords + { + get { return _Keywords; } + set + { + _Keywords = value; + NotifyPropertyChanged("Keywords"); + } + } + + public Array Genres + { + get + { + return Enum.GetValues(typeof(Genres)); + } + } + + private Genres? _SelectedGenre; + public Genres? SelectedGenre + { + get { return _SelectedGenre; } + set + { + _SelectedGenre = value; + NotifyPropertyChanged("SelectedGenre"); + } + } + + public Array Ratings + { + get + { + return Enum.GetValues(typeof(Ratings)); + } + } + + private Ratings? _SelectedRating; + public Ratings? SelectedRating + { + get { return _SelectedRating; } + set + { + _SelectedRating = value; + NotifyPropertyChanged("SelectedRating"); + } + } + + public void Search() + { + var message = new SearchMessage(Keywords, SelectedGenre, SelectedRating); + + MessageBus.Publish(message); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/CoreViewModelBase.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/CoreViewModelBase.cs new file mode 100644 index 0000000..1ae501b --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/CoreViewModelBase.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BrentEdwards.MVVM; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public abstract class CoreViewModelBase : ViewModelBase + { + public CoreViewModelBase() + { + ComponentContainer.BuildUp(this); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/DetailViewModel.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/DetailViewModel.cs new file mode 100644 index 0000000..0762176 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/DetailViewModel.cs @@ -0,0 +1,96 @@ +using System; +using System.Windows; +using System.Windows.Input; +using BrentEdwards.MVVM.Messaging; +using BrentEdwards.MVVM.Movies.Core.Messaging; +using BrentEdwards.MVVM.Movies.Core.ModalDialogs; +using BrentEdwards.MVVM.Movies.Core.Models; +using BrentEdwards.MVVM.Movies.Core.Repositories; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public sealed class DetailViewModel : CoreViewModelBase, ITitledViewModel + { + public DetailViewModel() + { + SaveCommand = new ActionCommand(Save); + CloseCommand = new ActionCommand(Close); + } + + public ICommand SaveCommand { get; private set; } + public ICommand CloseCommand { get; private set; } + + public IMessageBus MessageBus { get; set; } + public IMovieRepository MovieRepository { get; set; } + + private Boolean _IsEditable; + public Boolean IsEditable + { + get { return _IsEditable; } + set + { + _IsEditable = value; + NotifyPropertyChanged("IsEditable"); + } + } + + private Movie _Movie; + public Movie Movie + { + get { return _Movie; } + private set + { + _Movie = value; + NotifyPropertyChanged("Movie"); + } + } + + public Array Genres + { + get + { + return Enum.GetValues(typeof(Genres)); + } + } + + public Array Ratings + { + get + { + return Enum.GetValues(typeof(Ratings)); + } + } + + #region ITitledViewModel Members + + public String Title { get; private set; } + + #endregion + + public void Load(Movie movie) + { + Movie = movie; + if (movie.Id == -1) + { + IsEditable = true; + } + + Title = String.Format("{0} Details", Movie.Name); + } + + public void Save() + { + MovieRepository.Save(Movie); + + var message = String.Format("'{0}' was saved.", Movie.Name); + Dialog.ShowMessage(message, "Movie Saved", MessageBoxButton.OK); + } + + public void Close() + { + var message = new CloseViewMessage(Title); + + MessageBus.Publish(message); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/ITitledViewModel.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/ITitledViewModel.cs new file mode 100644 index 0000000..566029c --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/ITitledViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public interface ITitledViewModel + { + String Title { get; } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/MasterViewModel.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/MasterViewModel.cs new file mode 100644 index 0000000..a2d8756 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/MasterViewModel.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Windows.Input; +using BrentEdwards.MVVM.Messaging; +using BrentEdwards.MVVM.Movies.Core.Messaging; +using BrentEdwards.MVVM.Movies.Core.Models; +using BrentEdwards.MVVM.Movies.Core.Navigation; +using BrentEdwards.MVVM.Movies.Core.Repositories; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public sealed class MasterViewModel : CoreViewModelBase + { + public MasterViewModel() + : base() + { + MovieCommand = new ActionCommand(SelectMovie); + NewMovieCommand = new ActionCommand(NewMovie); + + MessageBus.Subscribe(HandleSearch); + + Movies = MovieRepository.Load(); + } + + public ICommand MovieCommand { get; private set; } + public ICommand NewMovieCommand { get; private set; } + + public IMessageBus MessageBus { get; set; } + public IMovieRepository MovieRepository { get; set; } + + private IList _Movies; + public IList Movies + { + get { return _Movies; } + private set + { + _Movies = value; + NotifyPropertyChanged("Movies"); + } + } + + public void SelectMovie(Object movie) + { + var message = new ShowViewMessage(MoviesViewTargets.Detail, movie); + + MessageBus.Publish(message); + } + + public void NewMovie() + { + var message = new ShowViewMessage(MoviesViewTargets.Detail, new Movie()); + + MessageBus.Publish(message); + } + + private void HandleSearch(SearchMessage search) + { + Movies = MovieRepository.Search(search.Keywords, search.Genre, search.Rating); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.Core/ViewModels/QuickSearchViewModel.cs b/BrentEdwards.MVVM.Movies.Core/ViewModels/QuickSearchViewModel.cs new file mode 100644 index 0000000..9c6d033 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.Core/ViewModels/QuickSearchViewModel.cs @@ -0,0 +1,38 @@ +using System; +using System.Windows.Input; +using BrentEdwards.MVVM.Messaging; +using BrentEdwards.MVVM.Movies.Core.Messaging; + +namespace BrentEdwards.MVVM.Movies.Core.ViewModels +{ + public sealed class QuickSearchViewModel : CoreViewModelBase + { + public QuickSearchViewModel() + : base() + { + SearchCommand = new ActionCommand(Search); + } + + public ICommand SearchCommand { get; private set; } + + public IMessageBus MessageBus { get; set; } + + private String _Keywords; + public String Keywords + { + get { return _Keywords; } + set + { + _Keywords = value; + NotifyPropertyChanged("Keywords"); + } + } + + public void Search() + { + var search = new SearchMessage(_Keywords); + + MessageBus.Publish(search); + } + } +} diff --git a/BrentEdwards.MVVM.Movies.sln b/BrentEdwards.MVVM.Movies.sln new file mode 100644 index 0000000..78cae87 --- /dev/null +++ b/BrentEdwards.MVVM.Movies.sln @@ -0,0 +1,66 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrentEdwards.MVVM.Movies", "BrentEdwards.MVVM.Movies\BrentEdwards.MVVM.Movies.csproj", "{9D8AF649-CF22-447F-A83D-CD17A75AE303}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrentEdwards.MVVM", "BrentEdwards.MVVM\BrentEdwards.MVVM.csproj", "{C590ED20-159A-48DF-9D83-1E4E9153DDFE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrentEdwards.MVVM.Test", "BrentEdwards.MVVM.Test\BrentEdwards.MVVM.Test.csproj", "{02D58A37-8F40-4B6B-A4B0-A4C3518D2260}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrentEdwards.MVVM.Movies.Core", "BrentEdwards.MVVM.Movies.Core\BrentEdwards.MVVM.Movies.Core.csproj", "{D10AC932-FFB4-4118-AE31-C628AA42BA91}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Debug|Any CPU.ActiveCfg = Debug|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Debug|x86.ActiveCfg = Debug|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Debug|x86.Build.0 = Debug|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Release|Any CPU.ActiveCfg = Release|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Release|Mixed Platforms.Build.0 = Release|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Release|x86.ActiveCfg = Release|x86 + {9D8AF649-CF22-447F-A83D-CD17A75AE303}.Release|x86.Build.0 = Release|x86 + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Debug|x86.ActiveCfg = Debug|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Release|Any CPU.Build.0 = Release|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C590ED20-159A-48DF-9D83-1E4E9153DDFE}.Release|x86.ActiveCfg = Release|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Debug|x86.ActiveCfg = Debug|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Release|Any CPU.Build.0 = Release|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {02D58A37-8F40-4B6B-A4B0-A4C3518D2260}.Release|x86.ActiveCfg = Release|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Debug|x86.ActiveCfg = Debug|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Release|Any CPU.Build.0 = Release|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D10AC932-FFB4-4118-AE31-C628AA42BA91}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BrentEdwards.MVVM.Movies/App.xaml b/BrentEdwards.MVVM.Movies/App.xaml new file mode 100644 index 0000000..920b158 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/BrentEdwards.MVVM.Movies/App.xaml.cs b/BrentEdwards.MVVM.Movies/App.xaml.cs new file mode 100644 index 0000000..ab6db32 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace BrentEdwards.MVVM.Movies +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/BrentEdwards.MVVM.Movies/BrentEdwards.MVVM.Movies.csproj b/BrentEdwards.MVVM.Movies/BrentEdwards.MVVM.Movies.csproj new file mode 100644 index 0000000..533c5c2 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/BrentEdwards.MVVM.Movies.csproj @@ -0,0 +1,154 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {9D8AF649-CF22-447F-A83D-CD17A75AE303} + WinExe + Properties + BrentEdwards.MVVM.Movies + BrentEdwards.MVVM.Movies + v4.0 + + + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\lib\castle\Castle.Core.dll + + + ..\lib\castle\Castle.Windsor.dll + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + AdvancedSearch.xaml + + + Detail.xaml + + + Master.xaml + + + QuickSearch.xaml + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + {D10AC932-FFB4-4118-AE31-C628AA42BA91} + BrentEdwards.MVVM.Movies.Core + + + {C590ED20-159A-48DF-9D83-1E4E9153DDFE} + BrentEdwards.MVVM + + + + + \ No newline at end of file diff --git a/BrentEdwards.MVVM.Movies/Configuration/ContainerConfiguration.cs b/BrentEdwards.MVVM.Movies/Configuration/ContainerConfiguration.cs new file mode 100644 index 0000000..36e153a --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Configuration/ContainerConfiguration.cs @@ -0,0 +1,84 @@ +using System; +using System.Windows; +using BrentEdwards.MVVM; +using BrentEdwards.MVVM.Messaging; +using BrentEdwards.MVVM.Movies.Core; +using BrentEdwards.MVVM.Movies.Core.ModalDialogs; +using BrentEdwards.MVVM.Movies.Core.Navigation; +using BrentEdwards.MVVM.Movies.Core.Repositories; +using BrentEdwards.MVVM.Navigation; +using Castle.MicroKernel.Registration; +using Castle.Windsor; +using BrentEdwards.MVVM.Movies.Client.Views; + +namespace Movies.Client.Configuration +{ + public sealed class ContainerConfiguration + { + public static void InitContainer() + { + var container = new WindsorContainer(); + ComponentContainer.Container = container; + + container.Register( + Component.For() + .ImplementedBy() + .LifeStyle.Singleton, + + Component.For() + .ImplementedBy() + .LifeStyle.Transient, + + Component.For() + .ImplementedBy() + .LifeStyle.Singleton, + + Component.For() + .ImplementedBy() + .LifeStyle.Singleton); + + InitNavigation(); + } + + private static void InitNavigation() + { + RegisterViewConfiguration(MoviesViewTargets.Detail); + } + + + private static void RegisterViewConfiguration(ViewTargets viewTarget) where TView : FrameworkElement + { + // If a view is named "Blah", register the ViewConfiguration as "Blah", + // the view as "BlahView", and the view model (if it needs to be explicitly + // defined) as "BlahViewModel". + ComponentContainer.Container.Register( + Component.For() + .Named(String.Format("{0}View", viewTarget.ToString())) + .ImplementedBy() + .LifeStyle.Transient, + Component.For() + .Named(viewTarget.ToString()) + .LifeStyle.Transient + .Parameters(Parameter.ForKey("view").Eq(String.Format("${{{0}View}}", viewTarget.ToString())))); + } + + private static void RegisterViewConfiguration(ViewTargets viewTarget) where TView : FrameworkElement + { + ComponentContainer.Container.Register( + Component.For() + .Named(String.Format("{0}ViewModel", viewTarget.ToString())) + .ImplementedBy() + .LifeStyle.Transient, + Component.For() + .Named(String.Format("{0}View", viewTarget.ToString())) + .ImplementedBy() + .LifeStyle.Transient, + Component.For() + .Named(viewTarget.ToString()) + .LifeStyle.Transient + .Parameters( + Parameter.ForKey("view").Eq(String.Format("${{{0}View}}", viewTarget.ToString())), + Parameter.ForKey("viewModel").Eq(String.Format("${{{0}ViewModel}}", viewTarget.ToString())))); + } + } +} diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/all-wcprops b/BrentEdwards.MVVM.Movies/Images/.svn/all-wcprops new file mode 100644 index 0000000..48616c9 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Images/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/EdwardsDigital/Movies/svn/!svn/ver/2/Movies.Client/Images +END +r.png +K 25 +svn:wc:ra_dav:version-url +V 64 +/EdwardsDigital/Movies/svn/!svn/ver/2/Movies.Client/Images/r.png +END +g.png +K 25 +svn:wc:ra_dav:version-url +V 64 +/EdwardsDigital/Movies/svn/!svn/ver/1/Movies.Client/Images/g.png +END diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/entries b/BrentEdwards.MVVM.Movies/Images/.svn/entries new file mode 100644 index 0000000..45c8843 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Images/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +9 +https://free1.projectlocker.com/EdwardsDigital/Movies/svn/Movies.Client/Images +https://free1.projectlocker.com/EdwardsDigital/Movies/svn + + + +2010-04-08T05:03:48.110541Z +2 +brent@edwardsdigital.com + + + + + + + + + + + + + + +b730c2a6-273e-432b-a057-9dbad7495766 + +r.png +file + + + + +2010-04-06T18:05:39.563532Z +3b7c8d76169b3c844515ac4fa8411757 +2010-04-08T05:03:48.110541Z +2 +brent@edwardsdigital.com +has-props + + + + + + + + + + + + + + + + + + + + +1501 + +g.png +file + + + + +2010-04-05T21:14:58.650388Z +856b89f9082c79358076905c0dc89bf7 +2010-04-05T22:01:24.922694Z +1 +brent@edwardsdigital.com +has-props + + + + + + + + + + + + + + + + + + + + +1662 + diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/g.png.svn-base b/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/g.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/g.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/r.png.svn-base b/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/r.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Images/.svn/prop-base/r.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/text-base/g.png.svn-base b/BrentEdwards.MVVM.Movies/Images/.svn/text-base/g.png.svn-base new file mode 100644 index 0000000000000000000000000000000000000000..63c21106589c006aa020775de7b6e9d8664ce8f2 GIT binary patch literal 1662 zcmeAS@N?(olHy`uVBq!ia0vp^&w<#FgBeJ^vHWNPq!^2X+?^QKos)S9`|ppBKboI^roR4CfB%j7^Y5=; z|8)QU*XPfFx_|%2`}hC<{|6d13PwX>=G3D=pKum4nJ@ErzW#^d=bQha~5KO?oDFA`@k_x|on+{b)bch1_I-!jsVwHDu=VtjXQ z@#SOD7TZ%{SrD?){&uzu5FnFI?iQHn&*nR@9NW-R~R{pBDKYKG(0G zTYYG8kY%-W=c3=7zFtpkj%cL+$YN=}WTC!Oi+R(#jSF^N`cR+j3RJ&F2Ka)q0WhtM{wj)RiZ`M=0&T;NkW85^I6&Qt6=C={no$IhB7Z zYc0PO%9S28M_lhmdDSg(1*5u8?=74KgW23)30W+^75?P5%eCif7OBmOhjyO39psc+ z$A3Lo^^%ch=T-%y_&+C4KbWJnZ)%dOh2u}jIl<4h4;8G}y-;{(x$!LZqueok&r7ua z^O%ZHd9)yxb$-27tUrg!l~*Z>t4=pv55C^6rN8{zTJaE7p7SqD@{ek_XtwjLJ|S#z z^_OwlR>xQQj`yYo$j_?1ze-NO`ugH`1_z(0{7`(p=bxADobS_LZm_%46E#=HHa2fR zkI3i1SF@hmTCYBvot02K`9ZrF_gTiT+vn_Wcl>T$U~zZKyNu`z-+4!7{8@SFeL-m++H+1yWH9v#!QC zDgRJ-UHNq9RUwO>6nmEIZ!R+5TdXd>v*6QnnV&}%sTY;~{H|Ap#1X4XlY95?%IRl2 wO+Tyu{6ES6>F#~sFD;0&*qcHE$g6UJc6ep00i_>zopr03tKEvH$=8 literal 0 HcmV?d00001 diff --git a/BrentEdwards.MVVM.Movies/Images/.svn/text-base/r.png.svn-base b/BrentEdwards.MVVM.Movies/Images/.svn/text-base/r.png.svn-base new file mode 100644 index 0000000000000000000000000000000000000000..8ab7b672e527fd3b1db722679aeaa5fadd7a01f7 GIT binary patch literal 1501 zcmeAS@N?(olHy`uVBq!ia0vp^&w)6AgBeI(eLCqrkYX$ja(7}_cTVOdki(Mh=Hhs6@8AFb{~u`7C>RZa;SmChn^TVheZpDb5n0T@z;_sg8IR|$NC65; zmbgZg1m~xflqVLYG6W=M=9TFAxrQi|8S9zqnb`H7DPv$@a`bd@45^5FJG(pYumX?k z+?H)RwJrbu-*S|f&I{*s-)$IYL@=Moree2{sSBhuW zn$AgZG_`P-S8n-eS#V%o0Iy&9?4r7a6*oFppO8Gq^Tkg;y6ot+S#uK4vC4MU#wD*f zB{^e3_8t9qi%-8Sa_k0*WX#ESds{o-M*sKS!cUdAKmOYDS?A5y#8M zzJ7B5E;jVM2(_&I!LBQ`vWRWk4gp5xs@QWMzPwe4x%5}_oaNrRmHCk$HmB74?LWjf z-M{dWU(Y6W>GYcxTa!|&wk-;oIe!@@XRD*F_5WkFT91yMKV5xiZsPLm?848*W)*&0 d`YG(oA2uz&mx-=?M%~6@vd$@?2>>#Wc}V~O literal 0 HcmV?d00001 diff --git a/BrentEdwards.MVVM.Movies/Images/g.png b/BrentEdwards.MVVM.Movies/Images/g.png new file mode 100644 index 0000000000000000000000000000000000000000..63c21106589c006aa020775de7b6e9d8664ce8f2 GIT binary patch literal 1662 zcmeAS@N?(olHy`uVBq!ia0vp^&w<#FgBeJ^vHWNPq!^2X+?^QKos)S9`|ppBKboI^roR4CfB%j7^Y5=; z|8)QU*XPfFx_|%2`}hC<{|6d13PwX>=G3D=pKum4nJ@ErzW#^d=bQha~5KO?oDFA`@k_x|on+{b)bch1_I-!jsVwHDu=VtjXQ z@#SOD7TZ%{SrD?){&uzu5FnFI?iQHn&*nR@9NW-R~R{pBDKYKG(0G zTYYG8kY%-W=c3=7zFtpkj%cL+$YN=}WTC!Oi+R(#jSF^N`cR+j3RJ&F2Ka)q0WhtM{wj)RiZ`M=0&T;NkW85^I6&Qt6=C={no$IhB7Z zYc0PO%9S28M_lhmdDSg(1*5u8?=74KgW23)30W+^75?P5%eCif7OBmOhjyO39psc+ z$A3Lo^^%ch=T-%y_&+C4KbWJnZ)%dOh2u}jIl<4h4;8G}y-;{(x$!LZqueok&r7ua z^O%ZHd9)yxb$-27tUrg!l~*Z>t4=pv55C^6rN8{zTJaE7p7SqD@{ek_XtwjLJ|S#z z^_OwlR>xQQj`yYo$j_?1ze-NO`ugH`1_z(0{7`(p=bxADobS_LZm_%46E#=HHa2fR zkI3i1SF@hmTCYBvot02K`9ZrF_gTiT+vn_Wcl>T$U~zZKyNu`z-+4!7{8@SFeL-m++H+1yWH9v#!QC zDgRJ-UHNq9RUwO>6nmEIZ!R+5TdXd>v*6QnnV&}%sTY;~{H|Ap#1X4XlY95?%IRl2 wO+Tyu{6ES6>F#~sFD;0&*qcHE$g6UJc6ep00i_>zopr03tKEvH$=8 literal 0 HcmV?d00001 diff --git a/BrentEdwards.MVVM.Movies/Images/r.png b/BrentEdwards.MVVM.Movies/Images/r.png new file mode 100644 index 0000000000000000000000000000000000000000..8ab7b672e527fd3b1db722679aeaa5fadd7a01f7 GIT binary patch literal 1501 zcmeAS@N?(olHy`uVBq!ia0vp^&w)6AgBeI(eLCqrkYX$ja(7}_cTVOdki(Mh=Hhs6@8AFb{~u`7C>RZa;SmChn^TVheZpDb5n0T@z;_sg8IR|$NC65; zmbgZg1m~xflqVLYG6W=M=9TFAxrQi|8S9zqnb`H7DPv$@a`bd@45^5FJG(pYumX?k z+?H)RwJrbu-*S|f&I{*s-)$IYL@=Moree2{sSBhuW zn$AgZG_`P-S8n-eS#V%o0Iy&9?4r7a6*oFppO8Gq^Tkg;y6ot+S#uK4vC4MU#wD*f zB{^e3_8t9qi%-8Sa_k0*WX#ESds{o-M*sKS!cUdAKmOYDS?A5y#8M zzJ7B5E;jVM2(_&I!LBQ`vWRWk4gp5xs@QWMzPwe4x%5}_oaNrRmHCk$HmB74?LWjf z-M{dWU(Y6W>GYcxTa!|&wk-;oIe!@@XRD*F_5WkFT91yMKV5xiZsPLm?848*W)*&0 d`YG(oA2uz&mx-=?M%~6@vd$@?2>>#Wc}V~O literal 0 HcmV?d00001 diff --git a/BrentEdwards.MVVM.Movies/MainWindow.xaml b/BrentEdwards.MVVM.Movies/MainWindow.xaml new file mode 100644 index 0000000..3fe86e2 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/MainWindow.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/BrentEdwards.MVVM.Movies/MainWindow.xaml.cs b/BrentEdwards.MVVM.Movies/MainWindow.xaml.cs new file mode 100644 index 0000000..ae1583d --- /dev/null +++ b/BrentEdwards.MVVM.Movies/MainWindow.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BrentEdwards.MVVM.Movies +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/BrentEdwards.MVVM.Movies/Properties/AssemblyInfo.cs b/BrentEdwards.MVVM.Movies/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a7ea07c --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("BrentEdwards.MVVM.Movies")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("BrentEdwards.MVVM.Movies")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BrentEdwards.MVVM.Movies/Properties/Resources.Designer.cs b/BrentEdwards.MVVM.Movies/Properties/Resources.Designer.cs new file mode 100644 index 0000000..7ccd5ab --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BrentEdwards.MVVM.Movies.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BrentEdwards.MVVM.Movies.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/BrentEdwards.MVVM.Movies/Properties/Resources.resx b/BrentEdwards.MVVM.Movies/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/BrentEdwards.MVVM.Movies/Properties/Settings.Designer.cs b/BrentEdwards.MVVM.Movies/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7b1b361 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BrentEdwards.MVVM.Movies.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/BrentEdwards.MVVM.Movies/Properties/Settings.settings b/BrentEdwards.MVVM.Movies/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml b/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml new file mode 100644 index 0000000..d39ebe8 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml.cs b/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml.cs new file mode 100644 index 0000000..8fe41d1 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Views/AdvancedSearch.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BrentEdwards.MVVM.Movies.Client.Views +{ + /// + /// Interaction logic for AdvancedSearch.xaml + /// + public partial class AdvancedSearch : UserControl + { + public AdvancedSearch() + { + InitializeComponent(); + } + } +} diff --git a/BrentEdwards.MVVM.Movies/Views/Detail.xaml b/BrentEdwards.MVVM.Movies/Views/Detail.xaml new file mode 100644 index 0000000..faed800 --- /dev/null +++ b/BrentEdwards.MVVM.Movies/Views/Detail.xaml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +