示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request[Resources.IdKey] != null)
            {
                int id = Convert.ToInt32(Request[Resources.IdKey]);
                if (Request["isDetail"] != null)
                {
                    presenter.RenderDetail(id);
                    return;
                }
                presenter.RenderEntity(id);
            }
            else
            {
                int defaultHomeId = Convert.ToInt32(AppSettingsReader.GetValue("HOMEPAGE_ID"));
                if (defaultHomeId > 0)
                {
                    int type = presenter.GetHomePageType(defaultHomeId);
                    switch (type)
                    {
                    case 105:
                        presenter.RenderEntity(defaultHomeId);
                        break;

                    default:
                        var asIsPresenter = new HomePagePresenter(this);
                        asIsPresenter.RenderDetail(defaultHomeId);
                        break;
                    }
                }
            }
        }
示例#2
0
 public HomePage()
 {
     Items = new ObservableCollection <PresentationItem>
     {
         new PresentationItem("Coffee table", "A Kitten", "image_placeholder.png"),
         new PresentationItem("Office Chair", "John Doe", "image_placeholder.png")
     };
     _presenter = new HomePagePresenter(new GetItemsInteractor(new ItemsGateway()), new Executor(), this, new ItemMapper());
     InitializeComponent();
 }
示例#3
0
 public void SetUp()
 {
     _itemsGateway = Substitute.For <IItemsGateway>();
     _itemsMaper   = new ItemMapper();
     _view         = Substitute.For <IBrowserView>();
     _presenter    = new HomePagePresenter(new GetItemsInteractor(_itemsGateway),
                                           new Executor(),
                                           _view,
                                           _itemsMaper);
 }
示例#4
0
        /*
         * Creates Home Page View and injects all required dependencies.
         */
        public Page CreateHomePage()
        {
            var homePageViewModel = new HomePageViewModel();
            var homePagePresenter = new HomePagePresenter(homePageViewModel, _mainService, _synchronizationContext);

            var homePageView = new HomePageView();

            homePageView.DataContext = homePageViewModel;

            return(homePageView);
        }