Graph works on first tabitem but not second tabitem?

Oct 6, 2011 at 11:52 AM

Hi, 

I am using Wpf Toolkit for the graph, and I realise that it doesn't work when I place it as the second tabitem. What could be the problem?

This is my graph:

 

<TabControl>

        <TabItem Header="PowerFlow">

        </TabItem>

        <TabItem Header="Graph" Name="Graphs">

            <ScrollViewer HorizontalScrollBarVisibility="Auto" 

   VerticalScrollBarVisibility="Auto" Margin="0,-28,0,28">

                <Grid Height="921" Background="DarkGray">

                    <chartingToolkit:Chart  Name="lineChart" Title="Power Graph" Background="YellowGreen" Foreground="DarkBlue"                      VerticalAlignment="Top" Margin="16,36,20,0" Height="432"  IsEnabled="True" >

                        <chartingToolkit:LineSeries Title="SolarCell" 

     ItemsSource="{Binding}" DependentValueBinding="{Binding Path=Value}" 

IndependentValueBinding="{Binding Path=Key}"

             IsSelectionEnabled="True" DataContext="{Binding}">

                            <chartingToolkit:LineSeries.DependentRangeAxis>

                                <chartingToolkit:LinearAxis Orientation="Y" Title="Power (W)"></chartingToolkit:LinearAxis>

                            </chartingToolkit:LineSeries.DependentRangeAxis>

                        </chartingToolkit:LineSeries>

                    </chartingToolkit:Chart>

                    <Button Content="Refresh" Height="23" HorizontalAlignment="Left" Margin="718,391,0,0" Name="button1" VerticalAlignment="Top" Width="75" />

                    <TextBox Height="23" HorizontalAlignment="Left" Margin="696,73,0,0" Name="textBox7" VerticalAlignment="Top" Width="97" Loaded="textBox7_Loaded" />

                    <Label Content="Time started:" Height="28" HorizontalAlignment="Left" Margin="606,73,0,0" Name="label1" VerticalAlignment="Top" Width="84" />

                </Grid>

            </ScrollViewer>

        </TabItem>

    </TabControl>

</Window>

 

 

 

 

Dec 15, 2011 at 11:17 PM

i think u have binding issue. The UI doesn't get binded I suggest put break point and recheck code