FrameworkElement Begin(VisualElement element, Animation animation)
        {
            if (element == null)
            {
                throw new Exception("The element name " + animation.Name_Object + " doesn't exisit in the current text");
            }
            FrameworkElement el = ConvertWPF.Convert(element);

            // Anima.Animate(el, element, animation);
            return(el);
        }
 /// <summary>
 /// Set the elements of a slide into a canvas.
 /// </summary>
 /// <param name="canvas">A Canvas where goes the elements</param>
 /// <param name="diap">The slide that contains the elements</param>
 /// <param name="for_show">Is true if the presentation is in edition mode</param>
 public void SetElements(Canvas canvas, Slide diap, bool for_show)
 {
     canvas.Children.Clear();
     canvas.ClipToBounds = true;
     canvas.Background   = ConvertWPF.ConvertToBrush(diap.Background);
     for (int i = 0; i < diap.Childrens.Count; i++)
     {
         FrameworkElement frame = ConvertWPF.Convert(diap.Childrens[i]);
         if (!for_show && HasAsoiciateAnimation(diap.Childrens[i]))
         {
             frame.Visibility = Visibility.Collapsed;
         }
         canvas.Children.Add(frame);
     }
 }
Beispiel #3
0
        public static int Animate(FrameworkElement element, VisualElement visual, Animation my_animacion, DoubleAnimation animation)
        {
            ResetValues(animation);
            TimeSpan span = ConvertWPF.ConvertToTime(my_animacion.Duration);

            if (my_animacion.Duration.Hour != 0 || my_animacion.Duration.Minutes != 0 || my_animacion.Duration.Seg != 0)
            {
                animation.Duration = span;
            }
            else
            {
                animation.Duration = new Duration(new TimeSpan(0, 0, 5));
            }
            return((int)(typeof(Anima)).GetMethod(my_animacion.Type.ToString()).Invoke(null, new object[] { element, visual, animation }));
        }
        /// <summary>
        /// Put the information of a slides into a Canvas
        /// </summary>
        /// <param name="slide">The slide where is the information</param>
        /// <returns>A new canvas with all his respective information</returns>
        public Canvas PutSlides(Slide slide)
        {
            Canvas nueva = new Canvas();

            nueva.Height = Main_Canvas.Height;
            nueva.Width  = Main_Canvas.Width;
            //nueva.Margin = new Thickness(2);
            nueva.Background = ConvertWPF.ConvertToBrush(slide.Background);

            foreach (var item in slide.Childrens)
            {
                nueva.Children.Add(ConvertWPF.Convert(item));
            }

            return(nueva);
        }