Ejemplo n.º 1
0
        /*
         * Link up the Host to the Target and initialize but do not start the timer
         * */
        public void BindToTarget(LayoutToLayoutTarget t)
        {
            Target          = t;
            t.Host          = this;
            translation     = new TranslateTransform(0, 0);
            RenderTransform = translation;

            Refresher          = new DispatcherTimer();
            Refresher.Interval = TimeSpan.FromMilliseconds(timeSpan);
            Refresher.Tick    += OnAnimStateInvalidated;

            UpdateFromTarget();
        }
Ejemplo n.º 2
0
 /*
  * Break the cyclical reference
  * */
 public void ReleaseFromTarget()
 {
     Target.Host = null;
     Target      = null;
 }
Ejemplo n.º 3
0
 /*
  * If the host gets unloaded, break the cyclical reference to make sure the GC does its job
  * */
 void OnUnload(object sender, RoutedEventArgs e)
 {
     Target.Host = null;
     Target      = null;
 }