Save Map extent to a file

Discussion created by aafgilbert01 on Jan 15, 2014
Latest reply on Jan 17, 2014 by aafgilbert01

I would like to save my map extent to a ini file to allow the user to start where he was the last time he worked with the application. I have a map packaged in a UserControl x:Class="WpfArcGis.GisControl" and the map is defined in the XAML as <esri:Map x:Name="MyMap".

In the GisControl class I have a the following method

Namespace WpfArcGis
    Public Class GisControl
        Protected Overrides Sub Finalize()
        End Sub
    End Class
End Namespace

If I try to access the MyMap.Extent to save the values, I receive the following message: "The current thread is not accessible."

Do you know what function should I use to save my map extent.