Skip to main content

Microsoft Silverlight

Answered Question ItemsCollection QuestionRSS Feed

(0)

slyi
slyi

Participant

Participant

824 points

254 Posts

ItemsCollection Question

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,

slyi

<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
bryant

Star

Star

9937 points

1,629 Posts

Silverlight MVP

Re: ItemsCollection Question

What do you mean one that supports Javascript? Are you talking about Silverlight 1.0?

-- bryant

Blog | Twitter
_________________
Dont forget to click "Mark as Answer" on the post that helped you.

FuryDiamond
FuryDiamond

Contributor

Contributor

3870 points

766 Posts

Re: ItemsCollection Question

Are you trying to replicate the functionality in Javascript or load the data from Javascript?

Please "Mark as Answer" if this post answered your question. :)

slyi
slyi

Participant

Participant

824 points

254 Posts

Answered Question

Re: ItemsCollection Question

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.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities