Пример #1
0
 public void Show()
 {
     state = ElementState.Showing;
     OutAnimation?.Reset();
     SaveProperties();
     InAnimation?.Play(false);
     InAnimation?.Apply(ref props);
 }
Пример #2
0
 public void Reset()
 {
     state = ElementState.Idle;
     InAnimation?.Reset();
     OutAnimation?.Reset();
     InAnimation?.Apply(ref props);
     OutAnimation?.Apply(ref props);
     SaveProperties();
 }
Пример #3
0
 public void Hide()
 {
     state = ElementState.Hiding;
     InAnimation?.Reset();
     SaveProperties();
     OutAnimation?.Play(true);
     OutAnimation?.Apply(ref props);
     if (OutAnimation != null)
     {
         OutAnimation.OnFinished += ZeroProperties;
     }
 }
Пример #4
0
        public virtual JObject ToJson()
        {
            JObject ob = new JObject();

            ob["bounds"]    = new JArray(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height);
            ob["margin"]    = new JArray(Margin);
            ob["drawOrder"] = DrawOrder;
            ob["opacity"]   = Opacity;
            ob["visible"]   = Visible;
            if (InAnimation != null)
            {
                ob["in"] = InAnimation.ToJson();
            }
            if (OutAnimation != null)
            {
                ob["out"] = OutAnimation.ToJson();
            }
            return(ob);
        }