Custom Content Not Redrawn

2 posts, 0 answers
  1. Joel
    Joel avatar
    41 posts
    Member since:
    Nov 2010

    Posted 29 Nov 2011 Link to this post

    This might be two problems, but I think they might be related.

    I'm putting custom content inside of a TimeBar.  I dynamically create the UI and add it as children of a StackPanel, which is the only child of the TimeBar itself.  Initially, the stack panel is empty.  The first problem is the time scales are not drawn.  There's no intervals (12:01, 12:02, etc) and there's no "12:00 AM" level either.

    When I fill in the content, nothing is shown at first, but if I touch the time slider, the contents are drawn as expected.  If I alter the UI elements after they're created, the same issue occurs.  The changes aren't shown at first, but the contents are redrawn properly after I touch the time slider.  The time interval labels are still not shown.

    Here is my TimeBar:
    <telerik:RadTimeBar x:Name="tbTimeline" Grid.Column="1" Background="Transparent"
                    PeriodStart="2011-01-01 12:00:00 AM" PeriodEnd="2011-01-01 12:11:00 AM"
                    SelectionStart="2011-01-01 12:03:00 AM" SelectionEnd="2011-01-01 12:03:06 AM"
                    MaxSelectionRange="0.00:00:06" MinSelectionRange="0.00:00:06" >
            <Style TargetType="telerik:ShadeControl">
                <Setter Property="Background" Value="Transparent" />
            <telerik:HourInterval />
            <telerik:MinuteInterval IntervalSpans="1,5,10,15,30"/>
        <StackPanel x:Name="spContents"/>

    I have another TimeBar which is almost identical, but doesn't seem to have either issue.  The only difference I can see is the second one has content added as part of the constructor, but this one doesn't have any content until the user adds something.

    Is there an issue with starting with the TimeBar having no actual contents?

    Is there a way to force the TimeBar to redraw its contents?  UpdateLayout and InvalidateArrange didn't seem to work.

  2. Joel
    Joel avatar
    41 posts
    Member since:
    Nov 2010

    Posted 01 Dec 2011 Link to this post

    This seems to have corrected itself when I came back the next day.  I didn't restart the computer, but I did restart IE/Visual Studio.  I'm not sure what fixed it.
  3. DevCraft R3 2016 release webinar banner
Back to Top