<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Silverlight 3D flip animation</title>
	<atom:link href="http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/feed/" rel="self" type="application/rss+xml" />
	<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/</link>
	<description>Simplifing structure without changing results</description>
	<lastBuildDate>Sun, 23 May 2010 01:08:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Kostkac</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-835</link>
		<dc:creator>Kostkac</dc:creator>
		<pubDate>Wed, 21 Oct 2009 12:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-835</guid>
		<description>Hi, it is possible to create this only with XAML?

Thanks, K</description>
		<content:encoded><![CDATA[<p>Hi, it is possible to create this only with XAML?</p>
<p>Thanks, K</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-801</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Mon, 20 Jul 2009 12:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-801</guid>
		<description>Excellent example indeed!!

However, I do run into the same problem, when replacing the controls with functional ones.

Any suggestions?

Regards,
Jim</description>
		<content:encoded><![CDATA[<p>Excellent example indeed!!</p>
<p>However, I do run into the same problem, when replacing the controls with functional ones.</p>
<p>Any suggestions?</p>
<p>Regards,<br />
Jim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Irfan</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-796</link>
		<dc:creator>Irfan</dc:creator>
		<pubDate>Wed, 24 Jun 2009 08:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-796</guid>
		<description>Excellent work.

I faced one problem when I tried to replace the controls with textboxes, bottons etc, but I cannot focus onto the textbox and unable to click on the button.

Is there any work around for that.

Thank You.</description>
		<content:encoded><![CDATA[<p>Excellent work.</p>
<p>I faced one problem when I tried to replace the controls with textboxes, bottons etc, but I cannot focus onto the textbox and unable to click on the button.</p>
<p>Is there any work around for that.</p>
<p>Thank You.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tode</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-791</link>
		<dc:creator>Tode</dc:creator>
		<pubDate>Mon, 01 Jun 2009 15:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-791</guid>
		<description>great example...

thank you</description>
		<content:encoded><![CDATA[<p>great example&#8230;</p>
<p>thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joel</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-780</link>
		<dc:creator>joel</dc:creator>
		<pubDate>Tue, 24 Mar 2009 19:05:49 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-780</guid>
		<description>I did in my presentation for Mix09.  If you skip to the end you will see a Web Slice I did for HatClub that uses projection to flip from one side of a view to another.  Here is a link to the example  http://thetophat.staging.terralever.com/</description>
		<content:encoded><![CDATA[<p>I did in my presentation for Mix09.  If you skip to the end you will see a Web Slice I did for HatClub that uses projection to flip from one side of a view to another.  Here is a link to the example  <a href="http://thetophat.staging.terralever.com/" rel="nofollow">http://thetophat.staging.terralever.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hari</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-778</link>
		<dc:creator>Hari</dc:creator>
		<pubDate>Tue, 24 Mar 2009 16:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-778</guid>
		<description>Did you try building this with the Silverlight 3 3D animations yet?</description>
		<content:encoded><![CDATA[<p>Did you try building this with the Silverlight 3 3D animations yet?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joel</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-772</link>
		<dc:creator>joel</dc:creator>
		<pubDate>Wed, 11 Mar 2009 23:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-772</guid>
		<description>What I demo is not images, but actual controls.</description>
		<content:encoded><![CDATA[<p>What I demo is not images, but actual controls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emma</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-771</link>
		<dc:creator>Emma</dc:creator>
		<pubDate>Wed, 11 Mar 2009 22:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-771</guid>
		<description>I&#039;ve seen a lot of these flip effects, but they are limited to just two images and just flipping vertically.  How can you modify to use not just images, but a datagrid or flip multiple controls?  and flip it horizontally?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve seen a lot of these flip effects, but they are limited to just two images and just flipping vertically.  How can you modify to use not just images, but a datagrid or flip multiple controls?  and flip it horizontally?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-646</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 01 Jul 2008 19:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-646</guid>
		<description>I spun this off as a class with a static methods so I could reuse it in many places.  Here&#039;s the code for anyone that wants to save some time.

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ScreenFlip
{
    public class FlipStoryboardCreator
    {
        public static void Create(UIElement front, UIElement back, out Storyboard sb, out ScaleTransform scale, out TimeSpan tsLastFrame)
        {
            double speed = 4;
            double flipRotation = 0;
            double flipped = 2;
            sb = new Storyboard();
            scale = new ScaleTransform();
            tsLastFrame = new TimeSpan();
            TimeSpan tsSideFlipped = new TimeSpan();

            int frames = 1;
            DoubleAnimationUsingKeyFrames daX = new DoubleAnimationUsingKeyFrames();
            tsLastFrame = new TimeSpan();
            while (flipRotation != flipped * 180)
            {
                flipRotation += speed;
                double flipRadian = flipRotation * (Math.PI / 180);
                double size = Math.Cos(flipRadian);
                double scalar = (1 / (1 / size));

                DiscreteDoubleKeyFrame ddkfX = new DiscreteDoubleKeyFrame();
                ddkfX.Value = (size * scalar);

                tsLastFrame = TimeSpan.FromMilliseconds(frames * 7);

                //the first time we flip to negative capture the tsLastFrame so we know when we will need to
                //visualize the flip side
                flipped = (size &lt; 0) ? +1 : +0;
                if (flipped == 1 &amp;&amp; tsSideFlipped.Ticks == 0)
                {
                    tsSideFlipped = tsLastFrame;
                }

                ddkfX.KeyTime = KeyTime.FromTimeSpan(tsLastFrame);

                //add the DiscreteDoubleKeyFrame to the DoubleAnimationUsingKeyFrames
                daX.KeyFrames.Add(ddkfX);

                flipRotation %= 360;
                frames++;
            }

            Storyboard.SetTarget(daX, scale);
            Storyboard.SetTargetProperty(daX, new PropertyPath(&quot;(ScaleX)&quot;));
            sb.Children.Add(daX);

            VisualizeSide(sb, tsSideFlipped, 0, TimeSpan.FromMilliseconds((tsSideFlipped.Milliseconds + 100)), back.Opacity, back);
            VisualizeSide(sb, TimeSpan.FromMilliseconds((tsSideFlipped.Milliseconds - 100)), front.Opacity, tsSideFlipped, 0, front);
            back.Opacity = 0;
        }

        private static void VisualizeSide(Storyboard sb, TimeSpan tsStart, double opacityStart, TimeSpan tsEnd, double opacityEnd, UIElement side)
        {
            DoubleAnimationUsingKeyFrames daOpacity = new DoubleAnimationUsingKeyFrames();
            SplineDoubleKeyFrame sdkfStart = new SplineDoubleKeyFrame();
            sdkfStart.Value = opacityStart;
            sdkfStart.KeyTime = tsStart;
            sdkfStart.KeySpline = DefineKeySpline(0, 0, 1, 1);
            daOpacity.KeyFrames.Add(sdkfStart);

            SplineDoubleKeyFrame sdkfEnd = new SplineDoubleKeyFrame();
            sdkfEnd.Value = opacityEnd;
            sdkfEnd.KeyTime = tsEnd;
            sdkfEnd.KeySpline = DefineKeySpline(0, 0, 1, 1);
            daOpacity.KeyFrames.Add(sdkfEnd);

            Storyboard.SetTarget(daOpacity, side);
            Storyboard.SetTargetProperty(daOpacity, new PropertyPath(&quot;(UIElement.Opacity)&quot;));

            sb.Children.Add(daOpacity);
        }

        private static KeySpline DefineKeySpline(double cp1X, double cp1Y, double cp2X, double cp2Y)
        {
            KeySpline ksStart = new KeySpline();
            ksStart.ControlPoint1 = new Point(cp1X, cp1Y);
            ksStart.ControlPoint2 = new Point(cp2X, cp2Y);
            return ksStart;
        }
    }
}</description>
		<content:encoded><![CDATA[<p>I spun this off as a class with a static methods so I could reuse it in many places.  Here&#8217;s the code for anyone that wants to save some time.</p>
<p>using System;<br />
using System.Net;<br />
using System.Windows;<br />
using System.Windows.Controls;<br />
using System.Windows.Documents;<br />
using System.Windows.Ink;<br />
using System.Windows.Input;<br />
using System.Windows.Media;<br />
using System.Windows.Media.Animation;<br />
using System.Windows.Shapes;</p>
<p>namespace ScreenFlip<br />
{<br />
    public class FlipStoryboardCreator<br />
    {<br />
        public static void Create(UIElement front, UIElement back, out Storyboard sb, out ScaleTransform scale, out TimeSpan tsLastFrame)<br />
        {<br />
            double speed = 4;<br />
            double flipRotation = 0;<br />
            double flipped = 2;<br />
            sb = new Storyboard();<br />
            scale = new ScaleTransform();<br />
            tsLastFrame = new TimeSpan();<br />
            TimeSpan tsSideFlipped = new TimeSpan();</p>
<p>            int frames = 1;<br />
            DoubleAnimationUsingKeyFrames daX = new DoubleAnimationUsingKeyFrames();<br />
            tsLastFrame = new TimeSpan();<br />
            while (flipRotation != flipped * 180)<br />
            {<br />
                flipRotation += speed;<br />
                double flipRadian = flipRotation * (Math.PI / 180);<br />
                double size = Math.Cos(flipRadian);<br />
                double scalar = (1 / (1 / size));</p>
<p>                DiscreteDoubleKeyFrame ddkfX = new DiscreteDoubleKeyFrame();<br />
                ddkfX.Value = (size * scalar);</p>
<p>                tsLastFrame = TimeSpan.FromMilliseconds(frames * 7);</p>
<p>                //the first time we flip to negative capture the tsLastFrame so we know when we will need to<br />
                //visualize the flip side<br />
                flipped = (size &lt; 0) ? +1 : +0;<br />
                if (flipped == 1 &amp;&amp; tsSideFlipped.Ticks == 0)<br />
                {<br />
                    tsSideFlipped = tsLastFrame;<br />
                }</p>
<p>                ddkfX.KeyTime = KeyTime.FromTimeSpan(tsLastFrame);</p>
<p>                //add the DiscreteDoubleKeyFrame to the DoubleAnimationUsingKeyFrames<br />
                daX.KeyFrames.Add(ddkfX);</p>
<p>                flipRotation %= 360;<br />
                frames++;<br />
            }</p>
<p>            Storyboard.SetTarget(daX, scale);<br />
            Storyboard.SetTargetProperty(daX, new PropertyPath(&#8220;(ScaleX)&#8221;));<br />
            sb.Children.Add(daX);</p>
<p>            VisualizeSide(sb, tsSideFlipped, 0, TimeSpan.FromMilliseconds((tsSideFlipped.Milliseconds + 100)), back.Opacity, back);<br />
            VisualizeSide(sb, TimeSpan.FromMilliseconds((tsSideFlipped.Milliseconds &#8211; 100)), front.Opacity, tsSideFlipped, 0, front);<br />
            back.Opacity = 0;<br />
        }</p>
<p>        private static void VisualizeSide(Storyboard sb, TimeSpan tsStart, double opacityStart, TimeSpan tsEnd, double opacityEnd, UIElement side)<br />
        {<br />
            DoubleAnimationUsingKeyFrames daOpacity = new DoubleAnimationUsingKeyFrames();<br />
            SplineDoubleKeyFrame sdkfStart = new SplineDoubleKeyFrame();<br />
            sdkfStart.Value = opacityStart;<br />
            sdkfStart.KeyTime = tsStart;<br />
            sdkfStart.KeySpline = DefineKeySpline(0, 0, 1, 1);<br />
            daOpacity.KeyFrames.Add(sdkfStart);</p>
<p>            SplineDoubleKeyFrame sdkfEnd = new SplineDoubleKeyFrame();<br />
            sdkfEnd.Value = opacityEnd;<br />
            sdkfEnd.KeyTime = tsEnd;<br />
            sdkfEnd.KeySpline = DefineKeySpline(0, 0, 1, 1);<br />
            daOpacity.KeyFrames.Add(sdkfEnd);</p>
<p>            Storyboard.SetTarget(daOpacity, side);<br />
            Storyboard.SetTargetProperty(daOpacity, new PropertyPath(&#8220;(UIElement.Opacity)&#8221;));</p>
<p>            sb.Children.Add(daOpacity);<br />
        }</p>
<p>        private static KeySpline DefineKeySpline(double cp1X, double cp1Y, double cp2X, double cp2Y)<br />
        {<br />
            KeySpline ksStart = new KeySpline();<br />
            ksStart.ControlPoint1 = new Point(cp1X, cp1Y);<br />
            ksStart.ControlPoint2 = new Point(cp2X, cp2Y);<br />
            return ksStart;<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/comment-page-1/#comment-641</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Tue, 24 Jun 2008 06:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/#comment-641</guid>
		<description>Great Post!

I do have a question. Would it be easy to make the Back grid larger then the front Grid? So that if you click on the front youll get more detail on the back side and still make a good 3d animation?</description>
		<content:encoded><![CDATA[<p>Great Post!</p>
<p>I do have a question. Would it be easy to make the Back grid larger then the front Grid? So that if you click on the front youll get more detail on the back side and still make a good 3d animation?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
