Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin Forms uwp释放模式上未显示氧图_Xamarin_Uwp_Oxyplot - Fatal编程技术网

Xamarin Forms uwp释放模式上未显示氧图

Xamarin Forms uwp释放模式上未显示氧图,xamarin,uwp,oxyplot,Xamarin,Uwp,Oxyplot,我创建了一个xamarin表单项目,它使用oxyplot和Rg.Plugins.Popupxamarin表单。 但是,该图不起作用。我修改了代码,参考了图,但在UWP上没有显示 另外,我用follow代码初始化了Rg.Plugins.Popup和oxyplot,我不知道我做错了什么。请帮忙。提前谢谢 在UWP项目App.xaml.cs中 Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies()); List&

我创建了一个xamarin表单项目,它使用oxyplot和
Rg.Plugins.Popup
xamarin表单。 但是,该图不起作用。我修改了代码,参考了图,但在UWP上没有显示

另外,我用follow代码初始化了Rg.Plugins.Popup和oxyplot,我不知道我做错了什么。请帮忙。提前谢谢

在UWP项目App.xaml.cs中

Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies());

List<Assembly> assembliesToInclude = new List<Assembly>();

 //Now, add in all the assemblies your app uses
                assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
                assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
                assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
                assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
                assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer).GetTypeInfo().Assembly);

 try
 {
 Xamarin.Forms.Forms.Init(e, assembliesToInclude);
 // replaces Xamarin.Forms.Forms.Init(e);
 }
catch (Exception ex) { }

OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
Xamarin.Forms.Forms.Init(e,Rg.Plugins.Popup.Popup.getExtraAssemblys());
List assembliesToInclude=新列表();
//现在,添加应用程序使用的所有程序集
assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.GetTypeInfo().Assembly);
尝试
{
Xamarin.Forms.Forms.Init(e,assembliesToInclude);
//替换Xamarin.Forms.Forms.Init(e);
}
捕获(例外情况除外){}
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
Xamarin形式和氧化图版本为

OxyPlot.Xamarin.Forms:1.1.0-unstable0011


Xamarin.Forms:4.2.0.709249

如果您想同时使用它们,可以将它们的汇编插入同一个列表中。有关更多信息,请参阅以下内容

List<Assembly> assembliesToInclude = new List<Assembly>();

Popup.Init();
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();

assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer).GetTypeInfo().Assembly);
var assemblies = Popup.GetExtraAssemblies();

assembliesToInclude.AddRange(assemblies);
var count = assembliesToInclude.Count;

try
{
    Xamarin.Forms.Forms.Init(e, assembliesToInclude);

}
catch (Exception ex) {

}
List assembliesToInclude=new List();
Popup.Init();
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.GetTypeInfo().Assembly);
var assemblies=Popup.getExtraAssembly();
assembliesToInclude.AddRange(assemblies);
var count=assembliesToInclude.count;
尝试
{
Xamarin.Forms.Forms.Init(e,assembliesToInclude);
}
捕获(例外情况除外){
}

I使用OxyPlot.Xamarin.Forms 1.1.0进行测试,它在uwp平台的发布模式下工作。我无法复制您的问题。谢谢您的回复Nico Zhu。你是对的。Oxyplot Xamrin 1.1.0在uwp发布模式下工作。我的代码中没有显示oxyplot图形的原因是我使用了Rg.Plugins.Popup和oxyplot。Xamarin.Forms.Forms.Init在这两个NuGet包之间是不同的。对于Rg.Plugins.Popup,我使用以下代码“Xamarin.Forms.Forms.Init(e,Rg.Plugins.Popup.Popup.getExtraAssemblys());”。对于Oxyplot,我使用“Xamarin.Forms.Forms.Init(e,assembliesToInclude);”。如果我注释掉Rg.Plugins.Popup,Oxyplot在uwp发布模式下工作良好。然而,当我同时使用它们时,oxyplot不起作用。你有好主意吗?谢谢,我解决了这个问题。我将列表集合修改为include=new List();列出集合ToInclude=Rg.Plugins.Popup.Popup.GetExtraAssemblys().ToList()。我删除了Xamarin.Forms.Forms.Init(e,Rg.Plugins.Popup.Popup.getExtraAssemblys());是的,有意义的是,您可以将弹出程序集插入到
assembliesToInclude
中,然后在
Xamarin.Forms.Forms.Init
方法中使用它们。我已经回复了答案,请查收。