ResetEvents causing background color issues

Feb 16, 2012 at 3:28 PM

I have placed the timeline control in my WPF app as shown in following XAML. I have bound it to a model view which collects a list of events and I use this list of events in timeline_ready event. I also set the min and max dates as part of the view model. However when I call timeline.resetevents method with this list, I get a white background around each of my events. I have tried various things but I cant get rid of this white background. I have the screenshot of how this background looks but I dont know how to attach that to this discussion.

Any help is highly appreciated!!

 

Here is my XAML and code behind-

private void OnTimelineReady(object sender, EventArgs e)
        {           
            PlanSummaryViewModel vm = this.DataContext as PlanSummaryViewModel;
            timeline.MinDateTime = DateTime.Parse(vm.StartDate);
            timeline.MaxDateTime = DateTime.Parse(vm.ExpiryDate);
            timeline.ResetEvents(vm.PlanActivities);
            
            
            //CollectionChangedEventManager.AddListener(timeline.SelectedTimelineEvents, this);
        }

 

 

 

<DockPanel DockPanel.Dock="Right" Background="#F8F8EC" Margin="5">
                    <StackPanel  DockPanel.Dock="Top" Orientation="Horizontal">
                        <Label Content="Forest Management Schedule" Style="{StaticResource SubHead}" />
                        <Button Content="Add Plan Activity" Style="{StaticResource LinkButton}" HorizontalAlignment="Right">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <cal:ActionMessage MethodName="AddPlanActivity"/>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </Button>
                    </StackPanel>
                   
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition
                            Height="*" />
                            <RowDefinition
                            Height="30" />
                        </Grid.RowDefinitions>
                        
                        <timeline:TimelineTray
                        x:Name="timeline" 
                            Grid.Row="0"
                        CalendarType="gregorian"
                        HorizontalAlignment="Stretch"
                        CurrentDateTime="today"
                            TimelineReady="OnTimelineReady"
                            Height="350">

                            <Grid.RowDefinitions>
                                <RowDefinition
                                Height="*" />
                                <RowDefinition
                                Height="50" />
                                <RowDefinition
                                Height="30" />
                            </Grid.RowDefinitions>

                            <timeline:TimelineBand
                            IsMainBand="True"
                            ItemSourceType="months"
                            TimelineWindowSize="15"
                            MaxEventHeight="130"
                            Margin="0,2,0,0"
                           
                            />

                            <timeline:TimelineBand
                            Grid.Row="1"
                            HorizontalAlignment="Stretch"
                            ItemSourceType="years"
                            TimelineWindowSize="16"
                            MaxEventHeight="4" />
                        </timeline:TimelineTray>
                    </Grid>
                </DockPanel>

 

 

Coordinator
Feb 16, 2012 at 6:51 PM

you can open a bug and attach image to it (or better yet, solution with repro)

Feb 17, 2012 at 3:47 PM

 

This issue was on styling on my side....so problem is solved. I had defined a default style for grid on application level and that caused this problem. Once I dis-inherited that style, everything worked fine!