Add project files.
This commit is contained in:
48
OemanTrader.WPF/Commands/UpdateCurrentViewModelCommand.cs
Normal file
48
OemanTrader.WPF/Commands/UpdateCurrentViewModelCommand.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using OemanTrader.FinantialModelingPrepAPI.Services;
|
||||
using OemanTrader.WPF.State.Navigators;
|
||||
using OemanTrader.WPF.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace OemanTrader.WPF.Commands
|
||||
{
|
||||
public class UpdateCurrentViewModelCommand : ICommand
|
||||
{
|
||||
public event EventHandler? CanExecuteChanged;
|
||||
private INavigator _navigator;
|
||||
|
||||
public UpdateCurrentViewModelCommand(INavigator navigator)
|
||||
{
|
||||
_navigator = navigator;
|
||||
}
|
||||
|
||||
public bool CanExecute(object? parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Execute(object? parameter)
|
||||
{
|
||||
if (parameter is ViewType)
|
||||
{
|
||||
ViewType viewType = (ViewType)parameter;
|
||||
switch (viewType)
|
||||
{
|
||||
case ViewType.Home:
|
||||
// OBS OBS
|
||||
//_navigator.CurrentViewModel = new HomeViewModel(MajorIndexViewModel.LoadMajorIndexViewModel(new MajorIndexService()));
|
||||
break;
|
||||
case ViewType.Portfolio:
|
||||
_navigator.CurrentViewModel = new PortfolioViewModel();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user