Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
Chart Disappears when inside a XamWebDialogWindow
posted

If I dynamically add a Chart to a DialogWindow and minimize & restore the window, the chart disappears.

Repro Steps:

1) App starts with window in normalized state. 
2) Minimize the window.
3) Maximize the window.  Notice chart is gone, but Legend still exists.
4) Normalize the window.  Notice now the chart is completely gone.

It looks like it only happens when using the separate MinimizedPanel for the window, but I'm not positive.  Any suggestions on workarounds?  Also, can you try against the service release build and see if it happens there too?  I really want to be able to offer the charts in windows for my app.

Thanks,
Keith


Repro XAML:

<UserControl x:Class="WindowingTest.ChartWindowTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300" Width="300">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>   
        <Canvas Grid.Row="0" x:Name="CanvasWindows" />
        <StackPanel Grid.Row="1" x:Name="PanelMinimized" Orientation="Horizontal" />       
    </Grid>
</UserControl>

Code Behind:

void ChartWindowTest_Loaded(object sender, RoutedEventArgs e)
{
    var data = new List<KeyValuePair<string, int>>();
    data.Add(new KeyValuePair<string, int>("Category 1", 50));
    data.Add(new KeyValuePair<string, int>("Category 2", 100));
    data.Add(new KeyValuePair<string, int>("Category 3", 20));
    data.Add(new KeyValuePair<string, int>("Category 4", 80));

    var chart = new XamWebChart();
    var series = new Series()
    {
        ChartType = ChartType.Bar,
        DataMapping = "Value = Value;Label = Key",
        DataSource = data
    };
    chart.Series.Add(series);

    var window = new XamWebDialogWindow()
    {
        Content = chart,
        MinimizedPanel = this.PanelMinimized,
        Header = "Chart",
        Width = 200,
        Height = 200,
    };

    this.CanvasWindows.Children.Add(window);
}

 

Parents Reply Children