OxyPlot Xamarin.Forms UWP Release Workaraound

This makes the plot visible in Release mode.
This commit is contained in:
dimitrijevic 2017-03-03 12:11:08 +01:00 коммит произвёл GitHub
Родитель b202093e02
Коммит 21b152f8ea
1 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -1,4 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.Reflection;
using Windows.ApplicationModel; using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation; using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml; using Windows.UI.Xaml;
@ -47,10 +49,24 @@ namespace SimpleDemo.UWP
rootFrame = new Frame(); rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed; rootFrame.NavigationFailed += OnNavigationFailed;
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); // added most for good measure - workaround says add all classes - but only this one class should sufice
//Also do this for all your other 3rd party libraries
Xamarin.Forms.Forms.Init(e);
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init(); OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
try
{
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
// replaces Xamarin.Forms.Forms.Init(e);
}
catch (Exception ex) { }
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{ {
//TODO: Load state from previously suspended application //TODO: Load state from previously suspended application