Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Help me Convert this WPF to Silverlight (Read 2307 times)
xarzu
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2011
Help me Convert this WPF to Silverlight
Dec 30th, 2011 at 8:20am
Print Post  
Help me Convert this WPF to Silverlight

I am interested in a Charles Petzold C# example that shows how to do a fisheye effect ( http://www.charlespetzold.com/blog/2009/05/Realizing-a-Fisheye-Effect-in-Silverl... ).  The XAML code samples are in WPF but I want to try this in Silverlight.

When I try to create the XAML code in Silverlight, the compiler complains in two locations:

    <Style TargetType="{x:Type Button}">
    Error      1      The type 'x:Type' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

    <Style.Triggers>
    Error      2      The attachable property 'Triggers' was not found in type 'Style'.

How do I convert this to Silverlight?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Help me Convert this WPF to Silverlight
Reply #1 - Dec 30th, 2011 at 12:14pm
Print Post  
Try with <Style TargetType="{Button}">. Note that you can't specify implicit styles in Silverlight as in WPF (ones that apply to all instances of a type). You will have to explicitly set the button's Style property to this style.

Regarding triggers, in Silverlight they were replaced by visual states, controlled via the VisualStateManager class. So you will have to move the trigger storyboard for the MouseEnter event to a VisualState="MouseOver" block as shown here:
http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager%28v=vs...

I hope that helps,
Stoyan
« Last Edit: Dec 30th, 2011 at 1:41pm by Stoyo »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint