protected void OnViewChanged(object sender, ViewChangedEventArgs args) { _activeController = FindController((c) => { var attribs = System.Attribute.GetCustomAttributes(c.GetType()); var metaAttrib = (ControllerMeta)attribs .Where(atr => atr.GetType() == typeof(ControllerMeta)) .ToList() .FirstOrDefault(); if (metaAttrib == null) { return(false); } return(metaAttrib.ViewType == args.NextViewType); }); }
public bool ShowView(System.Type viewType, IContext context = null) { ViewChangedEventArgs viewChangedEventArgs = new ViewChangedEventArgs(); viewChangedEventArgs.PrevViewType = _lastShownViewType; viewChangedEventArgs.NextViewType = viewType; var view = FindView(viewType); if (OnViewChangedHandler != null && view != null) { OnViewChangedHandler(this, viewChangedEventArgs); } _lastShownViewType = viewType; view?.Show(context); return(view != null); }