/// <summary> /// Attach the model and view to the presenter /// </summary> /// <param name="model">The model to attach</param> /// <param name="view">The view to attach</param> /// <param name="explorerPresenter">The presenter to attach to</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.table = model as PivotTable; this.view = view as PivotTableView; this.explorer = explorerPresenter; // Find ledgers to source data from this.view.SetLedgers(table); // Attach events to handlers this.view.UpdateData += OnUpdateData; this.view.StoreData += OnStoreData; this.view.ChangePivot += OnChangePivot; this.view.TrackChanges += OnTrackChanges; // Update the boxes based on the tracked changes this.view.Ledger.ID = table.Ledger; this.view.Expression.ID = table.Expression; this.view.Value.ID = table.Value; this.view.Row.ID = table.Row; this.view.Column.ID = table.Column; this.view.Pivot.ID = table.Pivot; this.view.Time.ID = table.ID; // Update gridview data (initial loading of data) OnUpdateData(null, EventArgs.Empty); }
public PivotTableViewModel(MainPageViewModel mainPageViewModel, PivotTableView pivotTableView) { this.mainPageViewModel = mainPageViewModel; this.pivotTableView = pivotTableView; }