无法在UWP项目中显示聚合图

本文关键字:显示 项目 UWP | 更新日期: 2023-09-27 18:02:58

我在我的项目中使用合成图。没有问题,当我使用它与droid项目xamarin,但当我添加一个UWP项目,我有问题。项目执行并给出消息"namespacename.exe退出,代码为0",窗口关闭。当我为合成图注释Xaml代码时,没有任何问题。我将uwp项目的syncfusion dll包含在uwp项目和主项目中。我正在使用Xamarin Forms 2.0,并使用版本14.2451.0.26。用于图表的综合DLL请查找代码片段:

<?xml version="1.0" encoding="UTF-8"?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:local="clr-namespace:EWSMobile;assembly=EWSMobile" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms" xmlns:EWSMobile="clr-namespace:EWSMobile;assembly=EWSMobile"
    xmlns:gauge="clr-namespace:Syncfusion.SfGauge.XForms;assembly=Syncfusion.SfGauge.XForms" xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms" x:Class="EWSMobile.Dashboard" Title="Dashboard">
                ------------------
                ------------------
                ------------------
                            <chart:SfChart x:Name="ChartNews"   IsVisible="{Binding IsVisibleNews}" IsEnabled="false" HeightRequest="270" BackgroundColor="#2a334f"  VerticalOptions="FillAndExpand">
                                                <chart:SfChart.Title>
                                                <chart:ChartTitle Text="News Analysis" TextColor="White" />
                                            </chart:SfChart.Title>
                                            <chart:SfChart.PrimaryAxis>
                                                <chart:CategoryAxis >
                                                ----------
                                                </chart:CategoryAxis>
                                            </chart:SfChart.PrimaryAxis>
                                            <chart:SfChart.SecondaryAxis>
                                                -------------
                                            </chart:SfChart.SecondaryAxis>
                                <chart:SfChart.Series>
                                    <chart:SplineSeries Label="Company"  XBindingPath="Week" ItemsSource="{Binding Date}" Color="#8a40af" />
                                </chart:SfChart.Series>
                            </chart:SfChart>
     -------------------

        </ContentPage.Content>
    </ContentPage>

请查看下面相同的消息:

线程0x247c已经退出,代码为0 (0x0)。'EWSUWP.exe' (CoreCLR: CoreCLR_UWP_Domain):加载了'匿名托管动态方法程序集'。线程0x2188已经退出,代码为0 (0x0)。线程0x1190已经退出,代码为0 (0x0)。程序'[2056]EWSUWP.exe'已退出,代码为0 (0x0)。

无法在UWP项目中显示聚合图

Syncfusion 14.2*需要Xamarin。表格2.3或更高版本

你还应该在你的UWP项目的MainPage构造函数中调用new SfChartRenderer();代码。

建议:使用所需组件创建POC,看看问题是否仍然存在。如果是,请将您的代码片段发布到SyncFusion支持以获得更好的答案。