├── Starter
└── FriendStorage
│ ├── FriendStorage.UI
│ ├── ViewModel
│ │ ├── MainViewModel.cs
│ │ ├── FriendEditViewModel.cs
│ │ ├── NavigationViewModel.cs
│ │ └── ViewModelBase.cs
│ ├── App.xaml.cs
│ ├── FriendStorageIcon.png
│ ├── App.config
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── View
│ │ ├── MainWindow.xaml.cs
│ │ ├── FriendEditView.xaml.cs
│ │ ├── NavigationView.xaml.cs
│ │ ├── NavigationView.xaml
│ │ ├── FriendEditView.xaml
│ │ └── MainWindow.xaml
│ ├── Styles
│ │ ├── Label.xaml
│ │ ├── TextBox.xaml
│ │ ├── Brushes.xaml
│ │ ├── CheckBox.xaml
│ │ ├── Button.xaml
│ │ └── DatePicker.xaml
│ ├── App.xaml
│ ├── Command
│ │ └── DelegateCommand.cs
│ └── FriendStorage.UI.csproj
│ ├── FriendStorage.DataAccess
│ ├── packages.config
│ ├── IDataService.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── FriendStorage.DataAccess.csproj
│ └── FileDataService.cs
│ ├── FriendStorage.Model
│ ├── Friend.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── FriendStorage.Model.csproj
│ └── FriendStorage.sln
├── .gitattributes
└── .gitignore
/Starter/FriendStorage/FriendStorage.UI/ViewModel/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace FriendStorage.UI.ViewModel
2 | {
3 | public class MainViewModel : ViewModelBase
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace FriendStorage.UI
4 | {
5 | public partial class App : Application
6 | {
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/ViewModel/FriendEditViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace FriendStorage.UI.ViewModel
2 | {
3 | public class FriendEditViewModel : ViewModelBase
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/ViewModel/NavigationViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace FriendStorage.UI.ViewModel
2 | {
3 | public class NavigationViewModel : ViewModelBase
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/FriendStorageIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thomasclaudiushuber/WPFandMVVM_TestDrivenDevelopment/HEAD/Starter/FriendStorage/FriendStorage.UI/FriendStorageIcon.png
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.DataAccess/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/View/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace FriendStorage.UI.View
4 | {
5 | public partial class MainWindow : Window
6 | {
7 | public MainWindow()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/View/FriendEditView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace FriendStorage.UI.View
4 | {
5 | public partial class FriendEditView : UserControl
6 | {
7 | public FriendEditView()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/View/NavigationView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace FriendStorage.UI.View
4 | {
5 | public partial class NavigationView : UserControl
6 | {
7 | public NavigationView()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.Model/Friend.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FriendStorage.Model
4 | {
5 | public class Friend
6 | {
7 | public int Id { get; set; }
8 |
9 | public string FirstName { get; set; }
10 |
11 | public string LastName { get; set; }
12 |
13 | public DateTime? Birthday { get; set; }
14 |
15 | public bool IsDeveloper { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.DataAccess/IDataService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FriendStorage.Model;
4 |
5 | namespace FriendStorage.DataAccess
6 | {
7 | public interface IDataService : IDisposable
8 | {
9 | Friend GetFriendById(int friendId);
10 |
11 | void SaveFriend(Friend friend);
12 |
13 | void DeleteFriend(int friendId);
14 |
15 | IEnumerable GetAllFriends();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/Styles/Label.xaml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/ViewModel/ViewModelBase.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Runtime.CompilerServices;
3 |
4 | namespace FriendStorage.UI.ViewModel
5 | {
6 | public class ViewModelBase : INotifyPropertyChanged
7 | {
8 | public event PropertyChangedEventHandler PropertyChanged;
9 |
10 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
11 | {
12 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/Styles/TextBox.xaml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | 18
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/Styles/Brushes.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Starter/FriendStorage/FriendStorage.UI/Command/DelegateCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace FriendStorage.UI.Command
5 | {
6 | public class DelegateCommand : ICommand
7 | {
8 | private readonly Action