This is a migrated thread and some comments may be shown as answers.

Expanding is slow and not smooth

2 Answers 201 Views
ExpanderControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Itamar
Top achievements
Rank 1
Itamar asked on 06 Feb 2014, 04:51 PM
Hi.
I am using a JumpList with RadExpander Control as items.
Two weird behaviors here:
1. When opening an item the first time and closing it, the expanded content is disappearing but the control doesn't collapse.
2. The whole expanding and collapsing experience is really slow and bumpy.

Here is the code:
<phone:LongListSelector Grid.Row="1" IsGroupingEnabled="False" ItemsSource="{Binding CurrentUserSession.UserData.Events}">
            <phone:LongListSelector.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <telerikPrimitives:RadExpanderControl Content="{Binding}" ExpandableContent="{Binding}">
                            <telerikPrimitives:RadExpanderControl.ContentTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="{Binding Picture}" Width="50" Height="50"/>
                                        <TextBlock FontSize="20" Foreground="Black" Text="{Binding Title}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </telerikPrimitives:RadExpanderControl.ContentTemplate>
                            <telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <TextBlock FontSize="15" Foreground="Gray" Text="{Binding Description}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
                        </telerikPrimitives:RadExpanderControl>
                    </StackPanel>
                </DataTemplate>
            </phone:LongListSelector.ItemTemplate>
        </phone:LongListSelector>

Data example is (Json):
    {
      "Title": "F I E S T A B O M B A R D A", 
      "Description": "FIRST FIESTA OF 2014 IN SEFTON PARK PALM HOUSE:\n\nAfter an incredible year of underground fiestas and two-day festiváls, Fiesta Bombarda welcomes 2014 in spectacular fashion; hosting a colourful carnival in the magnificent…\n\nS E F T O N P A R K P A L M H O U S E \n\nWe’ll be lighting up the stunning venue with an array of radiant music and rousing entertainment. Headlining the event will be Renegade Brass Band - a 12-piece Jazz Hip-Hop ensemble that thrill audiences with their boisterous songs and lively performances. Joining them will be a riotous ensemble of exciting bands and exhilarating circus performers.\n\nSo prepare yourselves for an all-encompassing celebration of song and dance.\n\nSATURDAY 8th FEBRUARY \nSEFTON PARK PALM HOUSE\n7PM – 1AM \n\n………………………………………………………………………………\n\nLive music from:\nRENEGADE BRASS BAND\nWE, THE UNDERSIGNED\nHIGHFIELDS\nMUTANT VINYL\nLONG FINGER BANDITS\nSING FOR YOUR SUPPER\n\nSpecial guest DJ sets from:\nOUTLIAR // BHOK // PULP TROPICANA\n\nAlso including:\nCircus Performers // Full Bar // ‘Bring The Fire’ Entertainers\n\n………………………………………………………………………………\n\nT I C K E T S:\n£5 EARLY BIRD (sold out) \n£7 ADV (sold out)\n£9 STANDARD (available on the door from 7pm) ", 
      "Picture": "https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-prn1/t1/c43.0.50.50/p50x50/1560461_330669297074138_2010393774_n.jpg", 
    }, 
    {
      "Title": "Brutaż #21", 
      "Description": "[30 godzin muzyki. Brutaż od 22 do 18, potem Recognition Records night, w międzyczasie Vegan brunch na górze.\n\nRave on, sit down and listen.]\n\n\"But volume, unlike gold, is free\" H.P. Baxxter\n\n✓ volt.mar \nminimood // maastricht\nhttp://www.residentadvisor.net/dj/volt.mar\n\n✓ We Will Fail LIVE\nmonotype\nhttps://soundcloud.com/wewillfail\n\n✓ Kelo\nbrutaż\nhttps://soundcloud.com/ale-olek-janeczek-tragarzy\n\n✓ Filip Lech\nwszystko, aż zabraknie miejsca\nhttps://soundcloud.com/fl23\n\nRRRKRTA-YTRYQLLE-LEKEFLF-NRYLTRRRRIELAHSL-NLTERHIKIWFQN-RRMK-WKKEN\n\n✓ more TBA\n\nentrance: 10 (10 for inevitable losses and damages)\n\nPlease use your heart as a telephone.", 
      "Picture": "https://fbcdn-photos-h-a.akamaihd.net/hphotos-ak-prn1/t1/c11.0.50.50/p50x50/71456_211178029077832_143707792_s.jpg", 
    }

2 Answers, 1 is accepted

Sort by
0
Itamar
Top achievements
Rank 1
answered on 06 Feb 2014, 05:04 PM
So I changed the wrapping control to RadDataBoundListBox and it is a bit faster and not so lurky.
However, it is still not smooth, and when the expandable content is kind bigger (see above for example) it is still not smooth.
0
Deyan
Telerik team
answered on 10 Feb 2014, 08:19 AM
Hi Itamar,

Thanks for writing.

You should keep in mind that a TextBlock element needs some time to calculate and show its contents, especially if there's text wrapping involved. This is an expensive, CPU bound operation and you should consider optimizing your app by reducing the content shown at once. What we do with the expander is explicitly measure the expandable content to calculate the height to expand the control to - so any further optimizations from our side are not quite possible.

Let us know if we can be of further assistance.

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Tags
ExpanderControl
Asked by
Itamar
Top achievements
Rank 1
Answers by
Itamar
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or