예제 #1
0
        public MainPage()
        {
            InitializeComponent();

            //var navigationPage = new NavigationPage(new MortgageCalculatorPage());
            //navigationPage.Icon = "schedule.png";
            //navigationPage.Title = "Schedule";

            //Children.Add(navigationPage);
            //Children.Add(new HomeOwnershipExpenseCalPage());

            var mortgagePage = new MortgagePage()
            {
                Title = "Mortgage"
            };

            _mortgagePageViewModel = new MortgagePageViewModel(mortgagePage);

            //if (Application.Current.Properties.ContainsKey("LoanAmount"))
            //{
            //    _mortgagePageViewModel.LoanAmount = (string)Application.Current.Properties["LoanAmount"];
            //    _mortgagePageViewModel.CanadianMortgageRate = (string)Application.Current.Properties["CanadianMortgageRate"];
            //    _mortgagePageViewModel.CompoundPeriodIndex = (int)Application.Current.Properties["CompoundPeriodIndex"];
            //    _mortgagePageViewModel.AmortizationPeriod = (int)Application.Current.Properties["AmortizationPeriod"];
            //    _mortgagePageViewModel.Term = (int)Application.Current.Properties["Term"];
            //    _mortgagePageViewModel.FirstPaymentDate = (DateTime)Application.Current.Properties["FirstPaymentDate"];
            //    _mortgagePageViewModel.PaymentFrequencyIndex = (int)Application.Current.Properties["PaymentFrequencyIndex"];
            //    _mortgagePageViewModel.ExtraPayment = (string)Application.Current.Properties["ExtraPayment"];
            //    _mortgagePageViewModel.PaymentInterval = (int)Application.Current.Properties["PaymentInterval"];
            //    _mortgagePageViewModel.ExtraAnnualPayment = (string)Application.Current.Properties["ExtraAnnualPayment"];
            //}

            mortgagePage.BindingContext = _mortgagePageViewModel;

            Children.Add(mortgagePage);
            Children.Add(new MortgageTablePage((MortgagePageViewModel)mortgagePage.BindingContext)
            {
                Title = "Mortgage Table"
            });
            Children.Add(new MortgageGuidePage()
            {
                Title = "Guide"
            });
        }
예제 #2
0
 public MortgageTablePage(MortgagePageViewModel mortgagePageViewModel)
 {
     _mortgagePageViewModel = mortgagePageViewModel;
     InitializeComponent();
 }