开发者

Is x:Array supported on Windows Phone 7

开发者 https://www.devze.com 2023-04-02 12:57 出处:网络
I\'m trying to use array in ConverterParameter in binding as described here, but I get the following error:

I'm trying to use array in ConverterParameter in binding as described here, but I get the following error:

The type 'x:Array' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

Is this extension supported on WP7? Or even better - is there a comprehensive list of differe开发者_开发问答nces between "desktop" and WP7 versions of XAML?


Look up the differences between WPF and Silverlight (for example this one). WP7 7.0 is Silverlight 3.0 with some goodies when 7.5 is Silverlight 4.0.

If I were you I wouldn't write my own converter (PDC session - it could have performance issues).

What are you trying to do?

EDIT: x:Array is not supported :P


I am not sure about windows phone 7 developement, but if x:Array is not supported then similar type of structure that you can refer explicitly is ArrayList ...

 <Window ...
         xmlns:local="clr-namespace:SomeNamespace;assembly=SomeProject"
         xmlns:sys="clr-namespace:System;assembly=mscorlib" 
         xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib"
         ...>
    <Window.Resources>
       <local:MyAppenderConverter x:Key="MyAppenderConverter"/>
       <coll:ArrayList x:Key="MyArrayList">
           <sys:String>Hello</sys:String>
           <sys:String>World</sys:String>
       </coll:ArrayList>
    </Window.Resources>
    <Grid>
       <TextBlock Text="{Binding}" 
                  Converter="{StaticResource MyAppenderConverter}"
                  ConverterParameter="{StaticResource MyArrayList}"/>
    </Grid>
 </Window> 

Let me know if this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号