From effdbe02b4b4087b662924413063d5f2e5b68e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Thu, 14 May 2020 23:59:26 +0200 Subject: [PATCH] The new WPF UI Can run and show existing Tournaments --- TrackerWPFUI/App.config | 29 ++++++++++++++++-- TrackerWPFUI/TrackerWPFUI.csproj | 6 ++++ TrackerWPFUI/ViewModels/ShellViewModel.cs | 37 ++++++++++++++++++++++- TrackerWPFUI/Views/ShellView.xaml | 33 ++++++++++++++++++-- 4 files changed, 99 insertions(+), 6 deletions(-) diff --git a/TrackerWPFUI/App.config b/TrackerWPFUI/App.config index 56efbc7..3cf582a 100644 --- a/TrackerWPFUI/App.config +++ b/TrackerWPFUI/App.config @@ -1,6 +1,29 @@  - - - + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TrackerWPFUI/TrackerWPFUI.csproj b/TrackerWPFUI/TrackerWPFUI.csproj index 7d20557..0cb5137 100644 --- a/TrackerWPFUI/TrackerWPFUI.csproj +++ b/TrackerWPFUI/TrackerWPFUI.csproj @@ -119,5 +119,11 @@ PreserveNewest + + + {27ba8b4b-4ef6-4ca2-8e43-7c930552ecd9} + TrackerLibrary + + \ No newline at end of file diff --git a/TrackerWPFUI/ViewModels/ShellViewModel.cs b/TrackerWPFUI/ViewModels/ShellViewModel.cs index 2a2c8b4..afb3865 100644 --- a/TrackerWPFUI/ViewModels/ShellViewModel.cs +++ b/TrackerWPFUI/ViewModels/ShellViewModel.cs @@ -4,10 +4,45 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TrackerLibrary; +using TrackerLibrary.Models; namespace TrackerWPFUI.ViewModels { - public class ShellViewModel:Conductor + public class ShellViewModel : Conductor { + + public ShellViewModel() + { + // Initialize the database connections + GlobalConfig.InitializeConnections(DatabaseType.Sql); + _existingTournaments = new BindableCollection(GlobalConfig.Connection.GetTournament_All()); + } + public void CreateTournament() + { + + } + + private BindableCollection _existingTournaments; + + public BindableCollection ExistingTournaments + { + get { return _existingTournaments; } + set { _existingTournaments = value; } + } + + private TournamentModel _SelectedTournament; + + public TournamentModel SelectedTournament + { + get { return _SelectedTournament; } + set + { + _SelectedTournament = value; + NotifyOfPropertyChange(() => SelectedTournament); + } + } + + } } diff --git a/TrackerWPFUI/Views/ShellView.xaml b/TrackerWPFUI/Views/ShellView.xaml index d00a835..3c3fbf9 100644 --- a/TrackerWPFUI/Views/ShellView.xaml +++ b/TrackerWPFUI/Views/ShellView.xaml @@ -5,8 +5,37 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:TrackerWPFUI.Views" FontSize="18" mc:Ignorable="d" WindowStartupLocation="CenterScreen" Icon="..\TournamentTracker.ico" - Title="ShellView" Height="450" Width="800"> + Title="ShellView" Height="500" Width="600"> - + + + + + + + + + + + + + + + Tournament Tracker + + + + + Existing Tournaments + + + + +