public bool OpenScreen(string screenName, String controllerName , Dictionary <string, object> parameters = null , bool isBackCommand = false , bool isRefresh = false) { try { ActionHandler.Busy = true; ActionHandlerEx.Busy = true; _baseActivity.ClearNavigationEvents(); DateTime startLoading = DateTime.Now; ValueStack = new ValueStack.ValueStack(BitBrowserApp.Current.ExceptionHandler); ValueStack.Push("common", _commonData); ValueStack.Push("context", this); ValueStack.Push("dao", DAL.DAO); ValueStack.Push("activity", _baseActivity); foreach (var variable in GlobalVariables) { ValueStack.Push(variable.Key, variable.Value); } if (parameters != null) { foreach (KeyValuePair <String, object> item in parameters) { ValueStack.Push(item.Key, item.Value); } } var controller = ControllerFactory.CreateInstance().CreateController <Controllers.ScreenController>(controllerName); ValueStack.Push("controller", controller); screenName = controller.GetView(screenName); var scr = (Screen)ScreenFactory.CreateInstance().CreateScreen <AndroidStyleSheet>(screenName, ValueStack, controller); var currentScreen = new ScreenData(screenName, controllerName, scr); FlipScreen(scr.View, isBackCommand, isRefresh); if (Settings.DevelopModeEnabled) { string message = string.Format("{0}\n{1}" , screenName , (DateTime.Now - startLoading).ToString("ss\\.ff")); Toast.MakeText(_baseActivity, message, ToastLength.Short).Show(); } ThreadPool.QueueUserWorkItem(Finish, CurrentScreen); CurrentScreen = currentScreen; return(true); } catch (Exception e) { HandleException(e); return(false); } }
public IScreenFactory CreateScreenFactory() { return(ScreenFactory.CreateInstance()); }