First of you have the issue of actually getting access to the files.
Getting the file content
If you have these files held somewhere serverside then you would use WebClient
to fetch the file using DownloadStringAsync
.
On the other hand if the user is to open a file locally then you need use the OpenFileDialog
class to ask them to open the file and then use OpenText
on the FileInfo
object that OpenFileDialog
provides to read the string data.
Parsing
Well its your format so you'll have to code that yourself.
_Generating UI elements
You will not have to convert it to Xaml. Since you want these vector items to be individually selectable elements then you probably want to use the set of Shape
types found in the System.Windows.Shapes
namely, Elipse
, Line
, Path
, Polygon
, Polyline
and Rectangle
.
No doubt the format in question has someway to define the position of these elements relative to a fixed 0,0 point. Hence the best panel to use to display these is a Canvas
.
You would read through each Vectored item, select create an instance of one of the appropriate shapes set its properties based on the data in the item. You would need to determine its correct location within a Canvas
and use the Canvas.Left
and Canvas.Top
attached properties. The add the shape to the Children
collection of the Canvas
.