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

Inserting new message at the beginning

3 Answers 33 Views
ConversationView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
esskar
Top achievements
Rank 1
esskar asked on 20 Nov 2013, 08:44 AM
Hello,

I am using the ConversationView to display messages from a long conversation.
To increase preformance, I load only the first 20 messages into the view, and I add a button to the internal RadJumpList.ListHeaderTemplate to load earlier messages per user request.

When I add those earlier messages (20 previous messages) I add them to the ItemSource by doing an ItemSource.Insert(0, newMessage).
The problem is now, that the last inserted message is now visible on top, so inserting earlier messages at the beginning, pushes existing messages down, but the behaviour i want is that it should push newly inserted messages up (out of the visible area).

I attached a image trying to show what i want to achieve. Notice, that the part above the red line is not visible to the user, but he can keep scrolling, if more messages are inserted.

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 22 Nov 2013, 09:14 AM
Hi Sascha,

Thank you for writing.

From the screenshot it seems like before the button is pressed it consumes some space on the screen and after its pressed it goes away and this place is used to display earlier messages. This sounds like the expected behavior since the button is inside the header (which always stays before all messages).

One option to provide a different behavior is to add a button to the page (but not as part of the Conversation View) so it is always visible and it always consumes the same amount of space on the screen. The other option to add more items is to use the PullToRefresh functionality by setting IsPullToRefreshEnabled to true. More information about PullToRefresh is available here.

I hope this information helps.

Regards,
Todor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
esskar
Top achievements
Rank 1
answered on 20 Feb 2014, 04:31 PM
I finally figured it out.

I changed the ControlTemplate for the "telerikDataControls:RadConversationView" control

<ControlTemplate x:Key="CustomRadConversationViewControlTemplate"<br>                         TargetType="telerikDataControls:RadConversationView">

and set the VirtualizationStrategyDefinition for the "PART_ListBox" element to

<telerikDataControls:RadJumpList.VirtualizationStrategyDefinition><br>    <telerik:StackVirtualizationStrategyDefinition ReorderMode="MoveItemsUp" /><br></telerikDataControls:RadJumpList.VirtualizationStrategyDefinition>

0
Todor
Telerik team
answered on 25 Feb 2014, 12:15 PM
Hi Sascha,

Thank you for sharing your solution. We will consider this thread closed.

Don't hesitate to get back to us if you have other questions.

Regards,
Todor
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
ConversationView
Asked by
esskar
Top achievements
Rank 1
Answers by
Todor
Telerik team
esskar
Top achievements
Rank 1
Share this question
or