public static void Animate(this KeyFrame frame, Stage stage) { Console.WriteLine (frame); //Console.WriteLine (NSThread.IsMain); if (frame.Duration == 0) { frame.Tween.SetState(frame.ObjectName,stage); return; } if (frame.Easing == EdgeEasing.EaseOut) UIView.SetAnimationCurve (UIViewAnimationCurve.EaseOut); else UIView.SetAnimationCurve (UIViewAnimationCurve.Linear); UIView.Animate (((double)frame.Duration) / 1000, () => { frame.Tween.SetState(frame.ObjectName,stage); }); }
public virtual async void LoadStage () { Stage = await StageExtensions.Load ("index_edge.js"); View = Stage.ToUIView (); Stage.Animate (); }
static Stage ParseStage(JObject obj) { var stage = new Stage () { BaseState = (string)obj ["baseState"], InitialState = (string)obj ["initialState"], Content = ParseContent ((JArray)obj ["content"] ["dom"]), States = ParseStates ((JObject)obj ["states"]), Timelines = ParseTimelines (obj ["timelines"]), }; return stage; }
public static void SetState(this EdgeObjectState state,string id, Stage Stage) { var childView = Stage.NaviveViews [id] as UIView; if (childView == null) return; switch (state.PropertyType) { case EdgeObjectStateType.Color: state.SetColor (childView); break; case EdgeObjectStateType.Transform: state.SetTransform (childView); break; case EdgeObjectStateType.Style: state.SetStyle (childView); break; } }