Jumplist elements not resizing as expected

6 posts, 1 answers
  1. George
    George avatar
    6 posts
    Member since:
    Jun 2010

    Posted 13 Apr 2011 Link to this post

    I'm using the databound JumpList where a background worker thread gets info from a web service which might contain a comment field.  There is a textblock in the JumpList, comment, which has its visiblity set to collapsed when there isn't a comment and is visible when there is text.  It starts off without text and collaspsed however when a comment arrives, it doesn't resize and show the comment.

    The Jump List and its datatemplate:

            <DataTemplate x:Key="DeviceDetailsTemplate">
                <Wp7Client_UserControls:Device DataContext="{Binding}"/>
            </DataTemplate
      
    <telerikDataControls:RadJumpList x:Name="DevicesJumpList" ItemTemplate="{StaticResource DeviceDetailsTemplate}">
        <telerikDataControls:RadJumpList.GroupDescriptors>
           <telerikData:PropertyGroupDescriptor PropertyName="RoomName"/>
         </telerikDataControls:RadJumpList.GroupDescriptors>
     </telerikDataControls:RadJumpList>

    And here is the Device that is referenced by the Data Template:

    <UserControl x:Class="Wp7Client.UserControls.Device"
        mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="160" d:DataContext="{d:DesignData /SampleData/DeviceSampleData.xaml}"
    >
        <Border x:Name="LayoutRoot"  BorderBrush="Maroon" CornerRadius="4" BorderThickness="1">
            <StackPanel Margin="-1">
                <TextBlock Margin="0" Padding="0" Text="{Binding Name}" TextWrapping="Wrap" />
                <Border BorderBrush="{Binding StateIndicatorColor}" BorderThickness="2">
                    <ProgressBar IsIndeterminate="{Binding IsBusy}" Height="4"/>
                </Border>
                <TextBlock x:Name="DeviceCategory" TextWrapping="Wrap" Text="{Binding CategoryName}"  />
            <Grid x:Name="DevicePanel" Visibility="Collapsed" Width="480" />
            <TextBlock x:Name="Comment" Visibility="{Binding CommentVisibility, Converter={StaticResource BooleanToVisiblityConverter}}"
                TextWrapping="Wrap" Text="{Binding Comment}" Foreground="#FF461B0D"/>
            </StackPanel>
        </Border>
    </UserControl>

    It is possible to have the elements in the JumpList resize when elements within a stackpanel have their visiblity changed from collapsed to visible?

    TIA,
    George
  2. Answer
    Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 14 Apr 2011 Link to this post

    Hello George,

    Thanks for contacting us and for the provided details.

    I would like to kindly ask you to prepare a sample Windows Phone 7 application that demonstrates your scenario and send it to us so that we can directly take a look at it and see what goes wrong.

    I would also like to note that using UserControl in DataTemplates for the visual items in the RadJumpList (and any other control that uses UI virtualization) is not recommended since the Silverlight framework parses the XAML for the UserControl each time a new instance of it is created (something tha happens many times when in  UI virtualization mode). In other words, the XAML string of UserControls is not cached. This my imply a significant performance hit on your application.

    Please note that in order to be able to attach your demo project you should open a new support ticket.

    Thanks for your time.

    Regards,
    Deyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. George
    George avatar
    6 posts
    Member since:
    Jun 2010

    Posted 16 Apr 2011 Link to this post

    Thank you Deyan, in fact the performance is abysmal and I was planning on addressing that issue next. So, I'll take your advice and get rid of the UserControl and replace it with XAML in the DataTemplate and take advantage of VIsualState to vary my UI. Perhaps this restructure will solve the problem I originally reported and if not, I'll package up a project as you requested and submit it.

    Thanks again,
    George
  5. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 18 Apr 2011 Link to this post

    Hi George,

    Thanks for getting back to us.

    For now, we will consider this thread closed.

    If you continue to experience the undesired behavior discussed below do not hesitate to get back to us. Please note that you will have to open a new support ticket in order to attach your demo application.

    Thanks for your time.

    All the best,
    Deyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. George
    George avatar
    6 posts
    Member since:
    Jun 2010

    Posted 04 May 2011 Link to this post

    As suggested I removed the UserControl from the DataTempate and now it performs as expected.  

    Also, the app spec has been changed and I no longer have to support dynamic visibility of TextBlocks. 

    AND... as always, thanks for such great Telerik support!
  7. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 05 May 2011 Link to this post

    Hi George,

    Thanks for writing back and for the feedback.

    We are happy to hear that you have managed to resolve your case.

    You can get back to us anytime you need further assistance or have feedback to share.

    Regards,
    Deyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner