Exemplo n.º 1
0
        public TimePage(IKitsTajmService service)
        {
            InitializeComponent();

            this._service = service;
            this._model = new TimeViewModel();
            this._weekmodels = new WeekModelRepository(this._service, this._model);

            var currentmodel = this._weekmodels.GetModel(DateTime.Now);
            var currentpage = new WeekPage(this._service, currentmodel);

            var previouspage = GetPreviousWeek(
                currentmodel,
                this._weekmodels,
                this._service);
            var nextpage = GetNextWeek(
                currentmodel,
                this._weekmodels,
                this._service);

            this.Children.Add(currentpage);
            this.Children.Insert(0, previouspage);
            this.Children.Add(nextpage);

            this._initialized = true;
        }
Exemplo n.º 2
0
 private static WeekPage GetNextWeek(
     WeekViewModel currentmodel,
     WeekModelRepository weekmodels,
     IKitsTajmService service)
 {
     return GetAnotherWeek(
         currentmodel,
         weekmodels,
         service,
         TimeSpan.FromDays(7));
 }
Exemplo n.º 3
0
        private static WeekPage GetAnotherWeek(
            WeekViewModel currentmodel,
            WeekModelRepository weekmodels,
            IKitsTajmService service,
            TimeSpan span)
        {
            var newpage = new WeekPage(
                service,
                weekmodels.GetModel(currentmodel.Monday.Date.Add(span)));

            return newpage;
        }