I'm working on a XIB to XAML (Xam.Forms and .NET MAUI) converter. I've generated a lit of the connections from the XIB but have hit a snag on constructing the XAML.
My old approach was to take each connection, grab the fragment based on the connection and throw it into an AbsoluteLayout. This sort of works, but it makes the XAML a bit of a mess and if you have the likes of a UIScrollView inside of the View itself, really messes things up (the elements inside the UIscrollview need to be held within the XAML ScrollView)
To ensure the XAML is being correctly generated, I'm trying to implement an indexing system so the likes of a UITabBar and UIScorllView have the correct elements within them.
My issue is that for these container types, I have an Id from the connector, but can't find the index of the node.
I have the following in my code
// I've read the xib in and obtained the connections
// I then iterate through the connections to get the property and destination
// which is stored in a dictionary<string, string>
// now to find the id from the dictionary.Value
var d = XDocument.Load(infile);
var nod = d.Descendants();
foreach (var t in Outlets.Values)
{
var c = 0;
if (d.Root.Attribute("id").Value == t)
{
// I have the correct id for the connection
// how do I get the index for this subview
// or am I better off storing the subview fragment
// parsing that, then the next etc.
}
}
The id attribute matches the destination so the if check works, however, I can't find the index of the line in the XIB so can't parse the objects in that subview