I'm trying to create a XamGeographicMap to show some data points. However, I'm getting all kinds of errors simply trying to use it as the sample. I can add an XamGeographicMap like this:
<ig:xamgeographicmap x:name="GeoMap">
But I get the following errors:
Error Property 'Content' does not support values of type 'XamGeographicMap'.
Error The tag 'XamGeographicMap.GeographicSymbolSeries' does not exist in XML namespace 'http://schemas.infragistics.com/xaml'.
However, it does run. But when I add anything (like a series) it fails again:
<ig:XamGeographicMap x:Name="GeoMap"> <ig:XamGeographicMap.Series> <ig:XamGeographicMap.GeographicSymbolSeries/> </ig:XamGeographicMap.Series> </ig:XamGeographicMap>
This time with the extra errors:
Error The member "Series" is not recognized or is not accessible.Error The attachable property 'Series' was not found in type 'XamGeographicMap'. Error The attachable property 'GeographicSymbolSeries' was not found in type 'XamGeographicMap'.
I'm referencing the libraries:
InfragisticsWPF4.Controls.Maps.XamGeographicMap.v13.2InfragisticsWPF4.DataVisualization.v13.2InfragisticsWPF4.v13.2
Hello Matthew,
It appears that you are missing a reference that is required to use the XamGeographicMap properly. I would recommend that you add a reference to InfragisticsWPF4.Controls.Charts.XamDataChart.v13.2 in order to resolve this issue.
A full list of the assemblies that are required for usage with specific controls can be found at the following webpage: http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=NetAdvantage_Assemblies.html.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thanks, that worked. I thought there must be a reference I was missing.
I'm still having trouble, for some reason the GeographicSymbolSeries just doesn't seem to be applied. I've set up a really simple series, pointing at some ViewModels I have:
<ig:XamGeographicMap x:Name="GeoMap"> <ig:XamGeographicMap.Series> <ig:GeographicSymbolSeries ItemsSource="{Binding WaypointViewModels}" LatitudeMemberPath="WaypointModel.Lat" LongitudeMemberPath="WaypointModel.Lon"> <ig:GeographicSymbolSeries.MarkerTemplate> <DataTemplate> <Ellipse Width="20" Height="20" Fill="Red"/> </DataTemplate> </ig:GeographicSymbolSeries.MarkerTemplate> </ig:GeographicSymbolSeries> </ig:XamGeographicMap.Series> </ig:XamGeographicMap>
But it doesn't appear in any form. When I put a breakpoint in the getter of the WaypointViewModels observable collection, it doesn't get called. There are also no binding errors, so I can assume it's finding WaypointViewModel or not even attempting to bind to it.
While I am not entirely sure exactly what your view model looks like here, I am assuming that WaypointViewModels exists as a property on the data context of your XamGeographicMap, but being that your WaypointViewModels getter never gets called, this may not be the case, and so you may want to re-evaluate the data context of your map. I cannot be entirely sure of this at the moment, though, as again, I do not know the structure of your ViewModel or your application on your end.
Being that I am rather unsure what your ViewModel structure is like, I felt that I would create a sample project to demonstrate the GeographicSymbolSeries working. Inside, I have a GeographicSymbolSeries bound to an ObservableCollection of custom objects. These custom objects have the properties of "Lat" and "Long" and so the Latitude and Longitude member paths of the series are "Lat" and "Long." This appears to work on my end in version 13.2, and the sample is attached to this post.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
It just doesn't seem to work on my end, though the sample you've sent works fine, I've copied your code pretty much word-for-word into my project and it just doesn't display values. My ViewModel is called "GeographicRouteViewModel" instead of "ViewModel".
It now seems to bind fin, the getter of "Data" gets called, and returns the three data objects. I can see the data context is properly set, and even sub-properties of the chart taking the data values:
The code is just a straight copy:
When I compare the visual tree, both have identical data - but in my solution it produces no Markers:
There's definitely some issue with binding in the GeographicSymbolSeries. I added the Binding diagnostics and I get the following:
System.Windows.Data Warning: 56 : Created BindingExpression (hash=57289408) for Binding (hash=65020119)System.Windows.Data Warning: 58 : Path: 'Data'System.Windows.Data Warning: 60 : BindingExpression (hash=57289408): Default mode resolved to OneWaySystem.Windows.Data Warning: 61 : BindingExpression (hash=57289408): Default update trigger resolved to PropertyChangedSystem.Windows.Data Warning: 62 : BindingExpression (hash=57289408): Attach to Infragistics.Controls.Maps.GeographicSymbolSeries.ItemsSource (hash=23210381)System.Windows.Data Warning: 67 : BindingExpression (hash=57289408): Resolving source System.Windows.Data Warning: 70 : BindingExpression (hash=57289408): Found data context element: GeographicSymbolSeries (hash=23210381) (OK)System.Windows.Data Warning: 71 : BindingExpression (hash=57289408): DataContext is nullSystem.Windows.Data Warning: 65 : BindingExpression (hash=57289408): Resolve source deferred
So the DataContext is null? Lets have a look at the data context, for a start, and to super make sure, I explicitely bound the data context of the GeographicSymbolSeries to the View's DataContext, which is set to the ViewModel:
<ig:GeographicSymbolSeries ItemsSource="{Binding Data, diag:PresentationTraceSources.TraceLevel=High}" DataContext="{Binding ElementName=View, Path=DataContext}" LatitudeMemberPath="Lat" LongitudeMemberPath="Long">
And I can also see it in the live property explorer. It is set to the view model, and has the data property, and that's populated with data:
I'm wondering whether the ItemsSource is bound before the data context, and doesn't get updated when the data context is set by my MVVM framework.
Is there a way to manually refresh the GeographicSymbolSeries?
I'm guessing it must be an issue with Caliburn.Micro and the DataContext/binding.
I've added the following "fudge" to the view's code behind:
private void GeographicRouteView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (e.NewValue is GeographicRouteViewModel) { SymbolSeries.ItemsSource = (e.NewValue as GeographicRouteViewModel).Data; } }
And it now functions fine.
I am rather unsure as well what would be causing this issue on your end, especially being that the data context and the binding expressions appear populated for your XamGeographicMap and the GeographicSymbolSeries that you are using. What is even stranger is the fact that setting the SymbolSeries' ItemsSource property programmatically is working for you here. I suppose it is possible that there is an issue with Caliburn.Micro, but I can't be sure on this.
Regarding manually "refreshing" the series, I suppose you could use the RenderSeries method, or perhaps UpdateLayout as this may cause the binding to update, but again, I can't be sure if this would really resolve this issue you are seeing.
I would like to look into this a bit further, but unfortunately I can't seem to reproduce this issue on my end. Would it be possible for you to please provide an isolated sample project where this is reproduced? I would also like to verify that we are using the same Infragistics assembly versions. Earlier in this case you had mentioned that you were using version 13.2, and so I have been testing against the latest public version of 13.2, which is 13.2.20132.2338. Is this the same assembly version you are using?