public VisualStateManager(StatePresenter presenter) { presenter.RegisterLoadActions( loaded: () => presenter.StateChanged += GoToState, unloaded: () => presenter.StateChanged -= GoToState ); }
public static StatePresenter AddVisualState(this StatePresenter presenter, UIControlState state, Action apply, Action restore) { var manager = _managers.GetValue(presenter, "Manager", () => new VisualStateManager(presenter)); manager.Add(state, new ObjectAnimation(apply, restore)); return(presenter); }