private void addPivotItem(DateTime dt) { _monthViewUserControl = new MonthView_Control(); _monthViewUserControl.LoadGridSetup(dt); _pivotItem = new PivotItem(); _pivotItem.Content = _monthViewUserControl; _pivotItem.DataContext = dt; _pivotItem.Margin = new Thickness(0, 0, 0, 0); _pivotItem.Header = dt.ToString("MMMM"); MonthsPivot.Items.Add(_pivotItem); }
private void backwardPan(DateTime addedDateTime) { var previousPivotItem = (PivotItem)getPreviousPivotItem(); if (previousPivotItem == null) { return; } var newDateTime = addedDateTime.AddMonths(-1); var monthViewItem = new MonthView_Control(); monthViewItem.LoadGridSetup(newDateTime); previousPivotItem.DataContext = newDateTime; previousPivotItem.Content = monthViewItem; previousPivotItem.Header = newDateTime.ToString("MMMM"); }
private void forwardPan(DateTime addedDateTime) { var lastPivotItem = (PivotItem)getLastPivotItem(); if (lastPivotItem == null) { return; } var newDateTime = addedDateTime.AddMonths(3); var monthViewItem = new MonthView_Control(); monthViewItem.LoadGridSetup(newDateTime); lastPivotItem.DataContext = newDateTime; lastPivotItem.Content = monthViewItem; lastPivotItem.Header = newDateTime.ToString("MMMM"); }