Select to view content in your preferred language

WPF vs Silverlight

733
1
03-17-2011 10:04 AM
AngelGonzalez
Frequent Contributor
I see lots of sample here on this forum regarding Silverlight. My question is do theses samples and issues apply to WPF?  Can I use the same interactive sample for Silverlight for a WPF app?

Any thoughts, ideas or comments will be useful especially from anyone creating WPF apps.

Thanks
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
There are some subtle differences in the two platforms. 

The interactive SDK for Silverlight has a WPF equivalent which is available for download here: http://help.arcgis.com/en/webapi/silverlight/help/index.html#//01660000000v000000.htm

To note some of their differences:

In SL, element binding is allowed under resources.
<Grid x:Name="LayoutRoot">
 <Grid.Resources>
  <esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}"/>
 </Grid.Resources>
</Grid>

In WPF, you need to do this in code-behind.

In SL, you can change cursor with: (Note TargetProperty and DiscreteObjectKeyFrame.Value)
<ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="root" Storyboard.TargetProperty="Cursor">
 <DiscreteObjectKeyFrame KeyTime="0" Value="None" />
</ObjectAnimationUsingKeyFrames>

In WPF, you need to
<ObjectAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="root" Storyboard.TargetProperty="(FrameworkElement.Cursor)">
 <DiscreteObjectKeyFrame KeyTime="0">
  <DiscreteObjectKeyFrame.Value>
   <Cursor>None</Cursor>
  </DiscreteObjectKeyFrame.Value>
 </DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
0 Kudos