Open generalloki opened 1 year ago
uixml is compiled to в c# ( g.cs) partially. Might need to create C# code with property assignments:
<TextBox Text="Test Button"
Name="textTextBox" Margin="0,10,0,0"
TextChanged="TextTextBox_TextChanged"
/>
generated code:
TextBox textTextBox=new TextBox();
textTextBox.Text="Test Button";
textTextBox.Margin= new Thickness("0,10,0,0");
UiXml Loader uses TryFindElement for all named elements. And it is slow recursively searches through all the controls. We probably need to rewrite this methods to use Dictionary
public FrameworkElement? TryFindElement(string name)
{
if (name is null)
throw new ArgumentNullException(nameof(name));
if (Name == name)
return this;
foreach (var child in LogicalChildrenCollection)
{
var result = child.TryFindElement(name);
if (result != null)
return result;
}
return null;
}
One more bug in UiXml reader:
Button without name with OnClick event in TabPage Shows error during UiXml Reading
This is an example from TabControlPage.g.cs which is generated from UiXml Section 1 and Section 2 generatyion should be rewitten
Also example from WebBrowserPage.g.cs: Here we have assignment of events to controls with empty names
I beleive we need to have private fields with autogenerated control declaration and generate code like this: