Good evening,
I am working on a program where some application config info is stored in a Userconfig.xml file. I am loading the file as an XMLDataProvider in the XAML via relative URI:
<XmlDataProvider x:Name="UserConfigDataSource" x:Key="UserConfigDataSource" Source="UserConfig.xml" d:IsDataSource="True"/>
I have a number of items throughout bound to elements in the document and an event handler that saves to the XMLDataProvider:
Private Sub SaveConfig(ByVal sender as Object, ByVal e as System.EventArgs)
'TODO: Add event handler implementation here
Dim SavePath As String = UserConfigDataSource.Source.LocalPath.ToString
Dim XMLDoc = UserConfigDataSource.Document
UserConfigDataSource.Document.Save(SavePath)
End Sub
When this executes I get the error "This operation is not supported for a relative URI". Is there a good way to produce an absolute URI (aside from getting the assembly executing location and trimming the executable filename from the end)? I expected this to be a somewhat simple procedure. Any help would be greatly appreciated.
Cory