public Invoice() { InitializeComponent(); Dispatcher.InvokeAsync(() => { DashboardCollaborator model = ObjectPool.Instance.Resolve <DashboardCollaborator>(); if (this.DataContext == null && model != null) { this.DataContext = model; } }); }
private void InitializeModels() { OrderCollaborator order = new OrderCollaborator(); MasterCollaborator master = new MasterCollaborator(); DashboardCollaborator report = new DashboardCollaborator(); StockCollaborator stock = new StockCollaborator(); ObjectPool.Instance.Register <OrderCollaborator>().ImplementedBy(order); ObjectPool.Instance.Register <MasterCollaborator>().ImplementedBy(master); ObjectPool.Instance.Register <DashboardCollaborator>().ImplementedBy(report); ObjectPool.Instance.Register <StockCollaborator>().ImplementedBy(stock); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); Task.Run(() => { Dispatcher.Invoke(() => { DashboardCollaborator model = ObjectPool.Instance.Resolve <DashboardCollaborator>(); if (this.DataContext == null && model != null) { this.DataContext = model; } }); }); }