Пример #1
0
        public override void OnApplyTemplate()
        {
            var timeSpan = new TimeSpan (0,0,0,1);

             m_first = GetTemplateChild ("REQUIRED_FOR_FIRST_ANIMATION") as PresentingSlideControl;
             m_second = GetTemplateChild ("REQUIRED_FOR_SECOND_ANIMATION") as PresentingSlideControl;

             if (m_first != null)
             {
            m_first.Opacity = 0;

            m_showFirstStoryboard = new Storyboard ();
            m_showFirstStoryboard.AnimateProperty (
               m_first,
               OpacityProperty,
               timeSpan,
               1.0
               );

            m_hideFirstStoryboard = new Storyboard ();
            m_hideFirstStoryboard.AnimateProperty (
               m_first,
               OpacityProperty,
               timeSpan,
               0.0
               );
             }

             if (m_second != null)
             {
            m_second.Opacity = 0;

            m_showSecondStoryboard = new Storyboard ();
            m_showSecondStoryboard.AnimateProperty (
               m_second,
               OpacityProperty,
               timeSpan,
               1.0
               );

            m_hideSecondStoryboard = new Storyboard ();
            m_hideSecondStoryboard.AnimateProperty (
               m_second,
               OpacityProperty,
               timeSpan,
               0.0
               );
             }

             base.OnApplyTemplate ();
        }