예제 #1
0
        private void ShowFinancialAccountView(ContaFinanceira contaFinanceira)
        {
            IFinancialAccountPresenter presenter = this._container.Resolve <IFinancialAccountPresenter>("IFinancialAccountPresenter", new ParameterOverrides {
                { "contaFinanceira", contaFinanceira }
            });

            presenter.CloseViewRequested += delegate(object sender, EventArgs eventArgs)
            {
                if (eventArgs == null)
                {
                    return;
                }

                if ((eventArgs is CloseViewEventArgs) && ((eventArgs as CloseViewEventArgs).CloseViewOption == CloseViewType.Submit))
                {
                    if (!this.Cadastro.ContasFinanceiras.Contains <ContaFinanceira>(presenter.ContaFinanceira))
                    {
                        this.Cadastro.ContasFinanceiras.Add(presenter.ContaFinanceira);
                    }
                    OnPropertyChanged("ContasFinanceiras");
                }
                OnPropertyChanged("Tipo");
                OnPropertyChanged("Situacao");
            };

            IBreadCrumbPresenter breadCrumb = this._container.Resolve <IBreadCrumbPresenter>();

            if (breadCrumb != null)
            {
                breadCrumb.AddCrumb("Conta Financeira", presenter);
            }
        }
예제 #2
0
 public void SetPresenter(IFinancialAccountPresenter presenter)
 {
     this.DataContext = presenter;
 }