Fix Scrollbar issues in WGM_Client-Silverlight


The scrollbar is set to scroll to bottom when a new message arrives. However instead of figuring out where the bottom is, I just say to sroll to Double.MaxValue, which is a huge number, and may have some random effects. I suggest either using a listbox control instead, and saying scroll to item, where the item is the last message added. This could take some research as you will have to make an item template and bind it to some list type that contains the messages. Goodluck.
Here is an example of the data template.
<DataTemplate x:Key="mainTemplate">           
                <Grid Name="MessageItem">
                        <ColumnDefinition  />
                    <TextBox BorderThickness="0" TextWrapping="Wrap">
                            <MultiBinding StringFormat="{}{0} {1} says">
                                <Binding Path="MessageDate" />
                                <Binding Path="Sender"/>                               
                        <Binding NotifyOnSourceUpdated="True"  ElementName="_messageList" Path="ActualWidth"/>
                <Expander Grid.Row="1" IsExpanded="True" ExpandDirection="Right">                 
                    <TextBox  Grid.Row="1" Text="{Binding Path=MessageText}" Grid.ColumnSpan="1" TextWrapping="Wrap" BorderThickness="1"  Padding="0">
                            <Binding NotifyOnSourceUpdated="True"  ElementName="_messageList" Path="ActualWidth"/>