diff --git a/PenaltyMaster3000/App.xaml b/PenaltyMaster3000/App.xaml index da77f29..ee1a9fd 100644 --- a/PenaltyMaster3000/App.xaml +++ b/PenaltyMaster3000/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:PenaltyMaster3000" - StartupUri="View/MainView.xaml"> + StartupUri="View/StartView.xaml"> diff --git a/PenaltyMaster3000/Images/football_ball.png b/PenaltyMaster3000/Images/football_ball.png new file mode 100644 index 0000000..9ffbaab Binary files /dev/null and b/PenaltyMaster3000/Images/football_ball.png differ diff --git a/PenaltyMaster3000/Images/whistle.png b/PenaltyMaster3000/Images/whistle.png new file mode 100644 index 0000000..c3d9117 Binary files /dev/null and b/PenaltyMaster3000/Images/whistle.png differ diff --git a/PenaltyMaster3000/Navigation/INavigationService.cs b/PenaltyMaster3000/Navigation/INavigationService.cs new file mode 100644 index 0000000..3b05436 --- /dev/null +++ b/PenaltyMaster3000/Navigation/INavigationService.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PenaltyMaster3000.Navigation +{ + public interface INavigationService + { + void NavigateTo(string pageKey); + } +} diff --git a/PenaltyMaster3000/Navigation/NavigationService.cs b/PenaltyMaster3000/Navigation/NavigationService.cs new file mode 100644 index 0000000..b9085ef --- /dev/null +++ b/PenaltyMaster3000/Navigation/NavigationService.cs @@ -0,0 +1,34 @@ +using PenaltyMaster3000.View; +using PenaltyMaster3000.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PenaltyMaster3000.Navigation +{ + public class NavigationService : INavigationService + { + private readonly StartView _startView; + + public NavigationService(StartView startView) + { + _startView = startView; + } + + public void NavigateTo(string pageKey) + { + switch(pageKey) + { + case "MainView": + MainView mainView = new MainView(); + _startView.Content = mainView; + break; + + default: + throw new ArgumentException($"PageKey {pageKey} non prise en charge."); + } + } + } +} diff --git a/PenaltyMaster3000/PenaltyMaster3000.csproj b/PenaltyMaster3000/PenaltyMaster3000.csproj index a06f26c..95a9935 100644 --- a/PenaltyMaster3000/PenaltyMaster3000.csproj +++ b/PenaltyMaster3000/PenaltyMaster3000.csproj @@ -87,10 +87,16 @@ App.xaml Code + + + MainView.xaml + + StartView.xaml + @@ -134,10 +140,20 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + + + + + diff --git a/PenaltyMaster3000/View/MainView.xaml b/PenaltyMaster3000/View/MainView.xaml index ff04e59..91acf57 100644 --- a/PenaltyMaster3000/View/MainView.xaml +++ b/PenaltyMaster3000/View/MainView.xaml @@ -1,17 +1,17 @@ - + Height="Auto" Width="Auto"> - + @@ -28,31 +28,85 @@ Grid.RowSpan="2" Grid.Column="0" Visibility="Hidden"/> + + + + + + + + + Grid.Column="1" + Visibility="Visible"/> + + + + + - + diff --git a/PenaltyMaster3000/View/MainView.xaml.cs b/PenaltyMaster3000/View/MainView.xaml.cs index d5bc0f4..59d23a3 100644 --- a/PenaltyMaster3000/View/MainView.xaml.cs +++ b/PenaltyMaster3000/View/MainView.xaml.cs @@ -18,7 +18,7 @@ namespace PenaltyMaster3000.View /// /// Logique d'interaction pour MainView.xaml /// - public partial class MainView : Window + public partial class MainView : UserControl { public MainVM MainVM { get; set; } diff --git a/PenaltyMaster3000/View/StartView.xaml b/PenaltyMaster3000/View/StartView.xaml new file mode 100644 index 0000000..1052a5a --- /dev/null +++ b/PenaltyMaster3000/View/StartView.xaml @@ -0,0 +1,39 @@ + + + + + + + + +