Hello,
I seem to be having an issue with using the StreamLoading event. I have successfully implemented the event as it is in the HowDoI examples, such as for the .shp file:
e.AlternateStream = Application.GetResourceStream(new Uri("MyMap.shp", UriKind.RelativeOrAbsolute)).Stream;
The problem I'm running into is when using a global Stream object that I have assigned the same stream as used in the above example to. I'll try to illustrate this here.
private Stream _shpStream = Application.GetResourceStream(new Uri("MyMap.shp", UriKind.RelativeOrAbsolute)).Stream;
...
public void StreamedShapeFileFeatureLayer_StreamLoading(object sender, StreamLoadingEventArgs e){
switch (System.IO.Path.GetExtension(e.AlternateStreamName).ToLower())
{
case ".shp":
e.AlternateStream = _shpStream;
break;
...
I repeatedly get an error that states 'Cannot access a disposed object'. I'm not really sure how this method changes anything. Would you have any input on what I'm doing wrong? Thanks very much for your continued support.
-Dustin