This question is locked. New answers and comments are not allowed.
I need some help with MapShaperReader: Source and DataSource binding. This is probably easy to answer but I have trouble binding these to static resources that would be updated/changed later at runtime on a button press. I need to pass them the map locations as strings, such as: "DataSources/europe.shp". Both require Uri as type so a IValueConverter i think is needed.
XAML:
c#
The implementation should probably be similar to http://forums.silverlight.net/t/229874.aspx/1
Any help is apreciated,
Thank you!
XAML:
<UserControl.Resources> <local:MSRResourceWraper x:Key="test"/> <local:Users x:Key="user" DataContext1="{Binding TT1, Source={StaticResource test}}" DataContext2="{Binding TT2, Source={StaticResource test}}"/> </UserControl.Resources><telerik:InformationLayer Name="wwww"> <telerik:InformationLayer.Reader> <telerik:MapShapeReader Source="{Binding DataContext1, Source={StaticResource user}}" DataSource="{Binding DataContext2, Source={StaticResource user}}"> </telerik:MapShapeReader> </telerik:InformationLayer.Reader></telerik:InformationLayer>public class Users { public Uri DataContext1 { get; set; } public Uri DataContext2 { get; set; } public Users() { //DataContext1 = new Uri("DataSources/africa.shp",UriKind.Relative); //DataContext2 = new Uri("DataSources/africa.dbf", UriKind.Relative); } } public class MSRResourceWraper : INotifyPropertyChanged { private Uri headerColor1 = new Uri("DataSources/africa.shp",UriKind.Relative); private Uri headerColor2 = new Uri("DataSources/africa.dbf", UriKind.Relative); public Uri TT1 { get { return headerColor1; } set { headerColor1 = value; OnPropertyChanged("TT"); } } public Uri TT2 { get { return headerColor2; } set { headerColor2 = value; OnPropertyChanged("TT"); } } public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); } } }The implementation should probably be similar to http://forums.silverlight.net/t/229874.aspx/1
Any help is apreciated,
Thank you!