apiascik
Topic Author
Posts: 1
Joined: 10 Apr 2018, 17:12

Graphing Library (OxyPlot?) for NoesisGUI (C#)

17 Apr 2018, 23:17

I'm very new to NoesisGUI and am working on creating an application that will, among other things, include a graph with dynamic data to the user. The application is currently just in C#. The best thing I could find was a Unity3D port of OxyPlot created a few years ago (viewtopic.php?t=905). I made several modifications to get the assemblies to build, and am now working on integrating them into my application.

I'm essentially starting with a basic example from OxyPlot (http://docs.oxyplot.org/en/latest/getti ... -xaml.html), which works just fine in my Blend/WPF solution. Unfortunately, the Noesis application throws the following exception when trying to load the control with the graph:

GraphControl.xaml(8): Unknown type 'Plot'

I'm hoping I'm missing something simple. Below are the relevant code snippets. Does anything stand out? Are there other approaches/libraries that would be better to start with (I didn't find any)?

GraphControl.xaml.cs:
public partial class GraphControl : UserControl
    {
        public GraphControl()
        {
            InitializeComponent();
        }

#if NOESIS
        private void InitializeComponent()
        {
            GUI.LoadComponent(this, "GraphControl.xaml");
        }
#endif
    }
GraphControl.xaml:
<UserControl x:Class="Example1.Controls.GraphControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:oxy="http://oxyplot.org/wpf"
             xmlns:local="clr-namespace:Example1.Controls"
             DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Grid>
        <oxy:Plot>
           <!-- Much like the example from OxyPlot, I previously had hardcoded data defined in code-behind, but I removed it for simplicity. -->
        </oxy:Plot>
    </Grid>
</UserControl>
I also tried explicitly referencing my (re)ported OxyPlot assemblies in the xaml with the same result:
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Noesis.Wpf"
I can create a Plot and series data in code behind with no issues.

Thanks
 
User avatar
sfernandez
Site Admin
Posts: 1928
Joined: 22 Dec 2011, 19:20

Re: Graphing Library (OxyPlot?) for NoesisGUI (C#)

20 Apr 2018, 11:09

Hi,

NoesisGUI doesn't load any assembly, it relies on domain loaded assemblies to search for any type referenced in the xaml.
I guess you are not loding the assembly containing OxyPlot type definitions before NoesisGUI is started.
You should manually load it (if not referenced in the project) before any xaml gets loaded by Noesis.

Please let me know if that fixes your problem.

Who is online

Users browsing this forum: Google [Bot] and 2 guests