Beispiel #1
0
 public void OnNavigatedTo(INavigationParameters parameters)
 {
     if (parameters.GetNavigationMode() == NavigationMode.Back)
     {
         if (Incomes != null && _incomesCount != Incomes.Count)
         {
             Incomes = new ObservableCollection <Income>(Incomes.OrderByDescending(income => income.Date));
         }
     }
 }
Beispiel #2
0
        /// <summary>
        ///     Initialises this instance ready for use. This should be done after loading the model from persistence.
        /// </summary>
        /// <exception cref="ValidationWarningException">The model is invalid.  + builder</exception>
        protected virtual void Initialise()
        {
            Expenses = Expenses.OrderByDescending(e => e.Amount).ToList();
            Incomes  = Incomes.OrderByDescending(i => i.Amount).ToList();

            var builder = new StringBuilder();

            if (!Validate(builder))
            {
                // Consumer should have already called validate and resolved any issues before calling Update+Initialise.
                throw new ValidationWarningException("The model is invalid. " + builder);
            }
        }