How to hide the date time stamp

3 posts, 0 answers
  1. Michael
    Michael avatar
    3 posts
    Member since:
    Apr 2012

    Posted 04 Feb 2014 Link to this post

    I am using the conversationview control but I do not wish to show the datetime stamp at the bottom of each conversation bubble.  Is there a way to hide this text? 
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 07 Feb 2014 Link to this post

    Hi Michael,

    You can hide the time stamp by creating different message templates. Below are the templates for the incoming and outgoing messages. You just have to remove the time stamp text block or hide it.

    Incoming template:
    <DataTemplate>
        <Grid Margin="12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="3*"/>
            </Grid.ColumnDefinitions>
            <telerikPrimitivesPrimitives:RadPointerContentControl Background="{StaticResource PhoneAccentBrush}"
                                                                  TargetPoint="160, 300"
                                                                  Grid.Column="1"
                                                                  Foreground="{StaticResource PhoneForegroundBrush}">
                <telerikPrimitivesPrimitives:RadPointerContentControl.PointerTemplate>
                    <DataTemplate>
                        <Polygon Width="12"
                                 Height="24"
                                 Points="0,0 12,0 12,12 0,24"
                                 StrokeThickness="0"
                                 Fill="{StaticResource PhoneAccentBrush}"
                                 RenderTransformOrigin="0.5, 0.5">
                            <Polygon.RenderTransform>
                                <ScaleTransform ScaleX="-1"/>
                            </Polygon.RenderTransform>
                        </Polygon>
                    </DataTemplate>
                </telerikPrimitivesPrimitives:RadPointerContentControl.PointerTemplate>
     
                <StackPanel>
                    <TextBlock Text="{Binding Path=Text}"
                               TextWrapping="Wrap"
                               Margin="12"/>
                    <TextBlock Text="{Binding Path=TimeStamp}"
                               Margin="12, 0, 12, 12"
                               HorizontalAlignment="Right"/>
                </StackPanel>
                </telerikPrimitivesPrimitives:RadPointerContentControl>
        </Grid>
    </DataTemplate>

    Outgoing Template:
    <DataTemplate>
        <Grid Margin="12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
     
            <telerikPrimitivesPrimitives:RadPointerContentControl Background="{StaticResource PhoneAccentBrush}"
                                                                  TargetPoint="-150,-300"
                                                                  Foreground="{StaticResource PhoneForegroundBrush}">
                <telerikPrimitivesPrimitives:RadPointerContentControl.PointerTemplate>
                    <DataTemplate>
                        <Polygon Width="12"
                                 Height="24"
                                 Points="0,0 12,0 12,12 0,24"
                                 StrokeThickness="0"
                                 Fill="{StaticResource PhoneAccentBrush}"
                                 RenderTransformOrigin="0.5, 0.5">
                            <Polygon.RenderTransform>
                                <ScaleTransform ScaleX="-1"/>
                            </Polygon.RenderTransform>
                        </Polygon>
                    </DataTemplate>
                </telerikPrimitivesPrimitives:RadPointerContentControl.PointerTemplate>
     
                <StackPanel>
                    <TextBlock Text="{Binding Path=Text}"
                               TextWrapping="Wrap"
                               Margin="12"/>
                    <TextBlock Text="{Binding Path=TimeStamp}"
                               Margin="12, 0, 12, 12"
                               HorizontalAlignment="Right"/>
                </StackPanel>
            </telerikPrimitivesPrimitives:RadPointerContentControl>
        </Grid>
    </DataTemplate>

    Regards,
    Victor
    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.
  3. DevCraft banner
  4. Michael
    Michael avatar
    3 posts
    Member since:
    Apr 2012

    Posted 07 Feb 2014 in reply to Victor Link to this post

    That worked like a charm.  Thanks!
Back to Top