Team Registration view v1
This commit is contained in:
@@ -1,9 +1,41 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace TournamentOrganizer.ViewModels;
|
||||
|
||||
public partial class MainViewModel : ViewModelBase
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string _greeting = "Welcome to Avalonia!";
|
||||
}
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace TournamentOrganizer.ViewModels;
|
||||
|
||||
public partial class MainViewModel : ViewModelBase
|
||||
{
|
||||
[ObservableProperty]
|
||||
private ViewModelBase _currentView;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _title = "Tournament Organizer";
|
||||
|
||||
public MainViewModel()
|
||||
{
|
||||
CurrentView = new HomeViewModel();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToHome()
|
||||
{
|
||||
CurrentView = new HomeViewModel();
|
||||
Title = "Tournament Organizer";
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task NavigateToTeams()
|
||||
{
|
||||
var teamsVm = new TeamsViewModel();
|
||||
CurrentView = teamsVm;
|
||||
Title = "Teams Management";
|
||||
await teamsVm.LoadTeams();
|
||||
}
|
||||
}
|
||||
|
||||
public partial class HomeViewModel : ViewModelBase
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string _welcomeMessage = "Welcome to Tournament Organizer!";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user