public bool OnActionPerformed <T>(IActionPerformer <T> sender, ActionPerformedEventArgs <T> args) where T : IViewModel, new() { if (this.Behaviors.ContainsKey(args.BehaviorName) == false) { return(false); } var behavior = this.Behaviors[args.BehaviorName] as IBehavior <T>; if (behavior == null) { return(false); } behavior.Execute(args); var viewName = this.Mapping[args.BehaviorName]; var nextView = this.GetNextView(viewName); this.OnBeforeViewSwitch(nextView, behavior); this.SwitchView(sender as ApplicationViewBase, viewName, args); return(true); }
public bool RaiseActionEvent <T>(ActionPerformedHandler <T> handler, ActionPerformedEventArgs <T> args) where T : IViewModel, new() { if (args == null) { return(false); } return(handler != null && handler(this as IActionPerformer <T>, args)); }
public bool OnActionPerformed <T>(ActionPerformedEventArgs <T> args) where T : IViewModel, new() { var success = false; foreach (var raiseActionEventDelegate in this.RaiseActionEventDelegates) { success = raiseActionEventDelegate.Invoke(args); } return(success); }
private void SwitchView <T>(IHideable sender, string viewName, ActionPerformedEventArgs <T> args) where T : IViewModel, new() { this.SwitchView(sender, viewName); this.RaiseViewSwitch(args, this.OnViewSwitch, viewName); if (sender is IActionPerformer <T> ) { this.CurrentViewName = viewName; } }
private void RaiseViewSwitch <T>(ActionPerformedEventArgs <T> args, ViewSwitchedMethodDelegate <T> viewSwitchedMethod, string viewName) where T : IViewModel, new() { viewSwitchedMethod(new ViewSwitchedEventArgs <T>(args) { DataItem = args.DataItem, CurrentViewName = viewName, PreviousViewName = this.CurrentViewName }); this.CurrentViewName = viewName; }