コード例 #1
0
        public CreateAimViewModel(INavigationService navigation, IAimManager manager)
        {
            SaveCommand = new RelayCommand(async() =>
            {
                var errorDetails = IsAimFilledCorrectly();

                if (errorDetails == null)
                {
                    await manager.SaveChangesAsync(new AimModel
                    {
                        Name           = Name,
                        CurrentBalance = CurrentBalance,
                        FinalBalance   = FinalBalance,
                        FinalDate      = FinalDate.Value,
                        StartDate      = StartDate.Value,
                    });

                    navigation.NavigateTo(PageKeys.MAIN_PAGE);
                }
                else
                {
                    Error = errorDetails;
                }
            });
        }
コード例 #2
0
 public AimActionsViewModel(IAimManager aimManager)
 {
     _aimManager = aimManager;
 }