2011-07-19 32 views
1

我下载从这里的示例代码: http://gallery.expression.microsoft.com/ShowHideWithFlipUIElement.Projection仅适用于Silverlight,不适用于WPF?

现在我的问题是,我使用WPF的家伙是使用Silverlight ..

我认为他们使用的是.NET 4两,但我发现那里是“.NET 4" ,并有totla指出错误的东西”为Silverlight .NET” ..

我得到这个错误:

'System.Windows.UIElement' does not contain a definition for 'Projection' and no extension method 'Projection' accepting a first argument of type 'System.Windows.UIElement' could be found (are you missing a using directive or an assembly reference?) 

我只是找到了原因,那家伙正在使用.NET对于Silverlight和我使用.NET 4

的Silverlight: http://msdn.microsoft.com/en-us/library/system.windows.uielement(v=VS.95).aspx

.NET 4:http://msdn.microsoft.com/en-us/library/system.windows.uielement.aspx

有一个解决方案?

我以为WPF和Silverlight是相同的(http://msdn.microsoft.com/en-us/library/ff921107(v=pandp.20).aspx)的金帝

我刚刚发现这一点:http://social.msdn.microsoft.com/Forums/en/wpf/thread/9acb712a-b592-49e7-83a1-e3ee7ff03014

这是我problam但我不能弄清楚如何使用的Viewport3D。 这里是代码的一部分:

 if (showElement.Projection == null) 
     { 
      showElement.Projection = new PlaneProjection(); 
      showElement.RenderTransformOrigin = new Point(.5, .5); 
     } 

     if (hideElement.Projection == null) 
     { 
      hideElement.Projection = new PlaneProjection(); 
      hideElement.RenderTransformOrigin = new Point(.5, .5); 
     } 

     mainStoryboard = new Storyboard(); 

     BackEase hide_ease = new BackEase() { EasingMode = EasingMode.EaseOut, Amplitude = 0.2 }; 

     // Show   
     PlaneProjection showPP = new PlaneProjection(); 
     CompositeTransform showCT = new CompositeTransform(); 
+1

在WPF中,您不需要'Projection'属性,因为您可以将贴图映射到3D平面上。由于Silverlight没有3D,他们添加了'Projection',只是为了使这一功能成为可能。 – Gabe

+0

所以,你知道我可以像在这个例子中做翻转效果吗? – Danpe

回答

1

不幸的是,这并不在WPF 3.5或4存在的,没有。仅在Silverlight中。但是,您肯定可以在WPF中推出自己的3-D。这里是3-D旋转控件的one example。这里是微软的文档Viewport3D

+0

你知道我可以像这个例子那样做翻转效果吗? – Danpe

+1

下面是仅用于Xaml的翻转列表项的解决方案:http://www.interact-sw.co.uk/iangblog/2007/05/17/wpf-flippable-3D-list –

相关问题