コード例 #1
0
 public ScreenHost(NamedType key,
                   TBaseView view,
                   IScreen screen,
                   Func <TBaseView, IScreenHost> createScreen,
                   Func <TBaseView, PopupAttribute, IScreenHost> createPopup,
                   PopupAttribute popupAttribute)
 {
     _key                     = key;
     _view                    = view;
     _screen                  = screen;
     _createScreen            = createScreen;
     _createPopup             = createPopup;
     _popupAttribute          = popupAttribute;
     _screen.PropertyChanged += OnPropertyChanged;
 }
コード例 #2
0
 public ScreenHost(NamedType key,
                   TBaseView view,
                   IScreen screen,
                   Func <TBaseView, IScreenHost> createScreen,
                   Func <TBaseView, PopupAttribute, IScreenHost> createPopup,
                   PopupAttribute popupAttribute)
 {
     this.key                  = key;
     this.view                 = view;
     this.screen               = screen;
     this.createScreen         = createScreen;
     this.createPopup          = createPopup;
     this.popupAttribute       = popupAttribute;
     this.screen.TitleChanged += OnTitleChanged;
 }
コード例 #3
0
 public ScreenHost(NamedType key,
                   TBaseView view,
                   IScreen screen,
                   Func <TBaseView, TScreen> createScreen,
                   Action <TScreen> showScreen,
                   Func <TBaseView, PopupAttribute, TPopup> createPopup,
                   Action <TPopup> showPopup,
                   PopupAttribute popupAttribute)
 {
     Key                      = key;
     _view                    = view;
     _screen                  = screen;
     _createScreen            = createScreen;
     _showScreen              = showScreen;
     _createPopup             = createPopup;
     _showPopup               = showPopup;
     _popupAttribute          = popupAttribute;
     _screen.PropertyChanged += OnPropertyChanged;
 }
コード例 #4
0
            public bool TryCreate(string instanceId, Func <IInternalScreen, object> getParameter, out IScreen logic, out TBaseView view, out Exception ex)
            {
                ex = null;
                try
                {
                    logic = _resolve(_idType) as IScreen;
                    if (logic is IInternalScreen internalScreen)
                    {
                        internalScreen.Setup(instanceId);
                        internalScreen.Parameter = getParameter(internalScreen);
                    }

                    view = _factory(logic);
                    return(true);
                }
                catch (Exception e)
                {
                    logic = null;
                    view  = null;
                    ex    = e;
                    return(false);
                }
            }
コード例 #5
0
            public bool TryCreate(string instanceId, object parameter, out IScreen logic, out TBaseView view, out Exception ex)
            {
                ex = null;
                try
                {
                    logic = _resolve(_idType) as IScreen;
                    var setupable = logic as IInternalScreen;
                    if (setupable != null)
                    {
                        setupable.Setup(instanceId);
                        setupable.Parameter = parameter;
                    }

                    view = _factory(logic);
                    return(true);
                }
                catch (Exception e)
                {
                    logic = null;
                    view  = null;
                    ex    = e;
                    return(false);
                }
            }