Discussion Board

Results 1 to 3 of 3
  1. #1
    Nokia Developer Champion
    Join Date
    Jun 2008

    Issue while expanding & collapsing in longlistselector

    I have implemented a long long list selector displaying a number of items.Each list item has a header & rectangle within it which are visible when any list item is expanded & gets hidden when collapsed.
    Now the long list selector behaves correctly when same item is expanded & then collapsed but if any list item is expanded when another list item is already in the expanded state then there gets created a space between those two list items which is equivalent to the size of rectangle present in each of the list items.
    So in all if an item is expanded is not collapsed by the user itself but makes it collapsed by selecting/expanding any other list item then such spacing gets created.

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2012

    Re: Issue while expanding & collapsing in longlistselector

    Can we have a loot at the expansion code snippet and also the event's method ? it might be helpful to locate the problem

  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008

    Re: Issue while expanding & collapsing in longlistselector

    sure, here's the item template used in long list selector for showing list items :

     <DataTemplate x:Key="ChnlItemTemplate">
                <StackPanel Orientation="Horizontal">
                        <Rectangle Width="65" Height="65" Opacity="0.7" Fill="white"/>
                        <Image delay:LowProfileImageLoader.UriSource="{Binding ImagePath}" Height="65" Width="65" Margin="0,0,0,0" DataContext="{Binding Icon}"/>
                    <toolkit:ExpanderView x:Name="listitemexpander"  Width="460"  Expanded="listitemexpander_Expanded" Collapsed="listitemexpander_Collapsed" IsExpanded="{Binding IsExpOrColp, Mode=TwoWay}"  Margin="10,19" FontSize="26" FontFamily="{StaticResource PhoneFontFamilyNormal}" >
                            <TextBlock Text="{Binding Title}" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="26"/>
                            <TextBlock x:Name="CurrProg" Text="{Binding _CurrentProgName}" FontFamily="{StaticResource PhoneFontFamilySemiLight}" Padding="6" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="24" Foreground="White" Width="300" />
                        <Grid >
                            <Rectangle Width="460" Height="90" Fill="#FCFCF9" Opacity="0.3" HorizontalAlignment="Stretch" VerticalAlignment="Top" Tap="Rectangle_Tap"/>
                                  <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
                                <Image x:Name="Playbtn" Source="/Resources/Images/ApplicationNew/video-play.png" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="25" Width="60" Height="60" Tap="Playbtn_Tap"/>
                                <Image x:Name="infobtn" Source="/Resources/Images/ApplicationNew/info.png" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" Height="60" Tap="infobtn_Tap"/>
                                <Image x:Name="favadd" Source="/Resources/Images/ApplicationNew/favs_addto.png" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="25"  Width="60" Height="60" Visibility="Visible" Tap="favadd_Tap" />
    In the above code, rectangle is there present inside each long list selector item which gets expanded & collapsed.
    And the event handler which is called when any new list item is selected:

    private void ChnlList_SelectionChanged(object sender, SelectionChangedEventArgs e)
                var obj = e.AddedItems[0] as GalleryData;
                if (iGalData != null)
                    if (iGalData.IsExpOrColp)
                          iGalData.IsExpOrColp = false;
                if (!obj.IsExpOrColp)
                      obj.IsExpOrColp = true;
                iGalData = obj;
                string CurrProgNameTmp = epglogic.GetEPGName(obj.Title);
                //CurrProgNameFinal = CurrProgNameTmp;
                StateManager.SelectedGalleryItem = obj.ID;
                if (CurrProgNameTmp != null)
                    string _CurrProgName = CurrProgNameTmp.Length > 21 ? CurrProgNameTmp.Trim().Substring(0, 21) + "..." : CurrProgNameTmp.Trim();
                    obj._CurrentProgName = _CurrProgName;
                CurrProgNameFinal = obj.Title;

Similar Threads

  1. WP8 LongListSelector - ScrollTo
    By Depechie in forum Windows Phone General
    Replies: 31
    Last Post: 2014-03-03, 09:32
  2. Slow animation when collapsing Border on Map
    By morfasie in forum Maps API for Windows Phone
    Replies: 6
    Last Post: 2013-04-02, 04:31
  3. Expanding memory using SD card
    By craigrathbone in forum Audio
    Replies: 1
    Last Post: 2010-05-02, 15:00
  4. Expanding text field in form
    By ekstrand_joachim in forum Symbian
    Replies: 10
    Last Post: 2008-10-23, 05:17
  5. MIDP3.0 - expanding MIDP2.0
    By zivgr in forum Mobile Java General
    Replies: 0
    Last Post: 2004-02-17, 14:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts