Do you have a more concrete example of what you need to do?I'm building this apps so that it set some option path according to selected projet (for my office). I would like to populate my DataGridTextColumn (or any other relevant UI element) with some info stored in an xml file. This file contains misc value like projet number, manager, units, etc... I've already writen the part were i write and read from xml (using some LINQ query).
Seems like I did this a little while back and pretty I used
XMLDataProvider
https://msdn.microsoft.com/en-us/library/system.windows.data.xmldataprovider(v=vs.110).aspx
I will see if I can dig it up
Maybe i'm going to far? How do you usually store information for persistent usage? in a .txt file?
Or you can use Serialization.I did not know about serialization/Deserialization... Seems like its exactly what i'm looking for... Now i'll have to find how to databind my property to my xaml code... (never stops...) Found the following for binary serialization (over SoapSerializer --> cant edit file & smaller filesize) (when defining classes you have to specify <Serializable()> at the beginning...);
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.IO
Public Class BinarySerializer
Shared Sub SerializeToFile(ByVal FileInfo As FileInfo, ByVal [Object] As Object)
Dim locFs As FileStream = New FileStream(FileInfo.FullName, FileMode.Create)
Dim locBinaryFormatter As New BinaryFormatter(Nothing, New StreamingContext(StreamingContextStates.File))
locBinaryFormatter.Serialize(locFs, [Object])
locFs.Flush()
locFs.Close()
End Sub
Shared Function DeserializeFromFile(ByVal FileInfo As FileInfo) As Object
Dim locObject As Object
Dim locFs As FileStream = New FileStream(FileInfo.FullName, FileMode.Open)
Dim locBinaryFormatter As New BinaryFormatter(Nothing, New StreamingContext(StreamingContextStates.File))
locObject = locBinaryFormatter.Deserialize(locFs)
locFs.Close()
Return locObject
End Function
End Class
about serialization/Deserialization... Seems like its exactly what i'm looking for... Now i'll have to find how to databind my property to my xaml code... (never stops...) Found the following for binary serialization (over SoapSerializer --> cant edit file & smaller filesize) (when defining classes you have to specify <Serializable()> at the beginning...);
I've attach a small project example showing both serialization type in action below... VB.NET of course... :-D