2

I write C# WPF MVVM application using MS VS 2015 and .NET Framework 4.5.2. I try to use LiveCharts. When LiveCharts is loading the folowing error has place: XamlParseException in PresentationFramework.dll. Could not load file or assembly "LiveCharts.Wpf, PublicKeyToken=3b585c2a5f1a92c1" or one of its dependencies. Below I present XAML:

<UserControl x:Class="DeviceReading.Views.DeviceReadingView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             prism:ViewModelLocator.AutoWireViewModel="True">

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>

    <lvc:CartesianChart Grid.Row="0" Grid.Column="0">
        <lvc:CartesianChart.Series>
            <lvc:LineSeries Values="{Binding MyObservableColection}" PointGeometrySize="10" StrokeThickness="2"/>
        </lvc:CartesianChart.Series>
        <lvc:CartesianChart.AxisX>
            <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" MaxValue="{Binding AxisMax}" MinValue="{Binding AxisMin}" DisableAnimations="True">
                <lvc:Axis.Separator>
                    <lvc:Separator Step="{Binding AxisStep}"/>
                </lvc:Axis.Separator>
            </lvc:Axis>
        </lvc:CartesianChart.AxisX>
    </lvc:CartesianChart>
</Grid>
</UserControl>

Here UserControl is Prism UserControl and MyObservableColection is the instance of

ObservableCollection<Tuple<DateTime, double>>

This collection comprises real-time data that I want to show in the Cartesian chart. I tryed to remove all code from the view model to which the UserControl is bound but the abovementioned error continues to occur. In the references section of PrismModule where the UserControl with LiveCharts is I added the folowing references: LiveCharts ver.0.7.10.0 and LiveCharts.WPF ver.0.7.10.0. I started to use the LiveCharts today so I'm green rookie in LiveCharts. Please help.

4

0 回答 0