Skip to main content
Home Forums Silverlight Programming Programming with .NET - General ItemsCollection Question
3 replies. Latest Post by slyi on October 14, 2009.
(0)
slyi
Participant
824 points
254 Posts
10-13-2009 12:52 PM |
Hi All,
I have below code that uses ItemsControl that replace my need for a custom ObjectCollection. That works fine in Silverlight managed code but i need something similar for javascript. So im wondering if there any other elements that support ItemsCollection?
Thanks,
<UserControl x:Class="app1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" > <UserControl.Resources> <ItemsControl x:Key="Array" > <sys:String>string1</sys:String> <sys:String>string2</sys:String> </ItemsControl> </UserControl.Resources> <ListBox x:Name="LayoutRoot" ItemsSource="{Binding Items,Source={StaticResource Array}}" /> </UserControl>
bryant
Star
9937 points
1,629 Posts
10-13-2009 12:55 PM |
What do you mean one that supports Javascript? Are you talking about Silverlight 1.0?
FuryDiamond
Contributor
3870 points
766 Posts
10-13-2009 1:25 PM |
Are you trying to replicate the functionality in Javascript or load the data from Javascript?
10-14-2009 6:48 AM |
Silverlight Javascript Api is SL 3 as it has some new SL 3 features like easing etc.. this is handy for loading page scenerios http://forums.silverlight.net/forums/t/134965.aspx
Ive came to the understanding this wont work as JS loose xaml does not support binding anyway.
So i had to do it via jquery http://cid-289eaf995528b9fd.skydrive.live.com/self.aspx/Public/SLjQueryBinding.zip
Thanks for help.