When creating UserControls, it looks like XAML is parsed every time the control is initialized.
For example, when I create a UserControl, an automatically generated code is generated to initialize the component, which looks like this:
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///Views/MyView.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); }
It was in Silverlight.
Creating a control one or two doesn't really matter, but if I have a large visual tree in each UserControl with visual states and bindings, and I create it many times for the application life cycle, it would be wise to create visual controls using C # to increase productivity.
So my question is:
Does the parser / framework parse the "XAML file" and not repeat it again on subsequent calls? That is, it creates a binary XAML representation, so it doesnβt need to read the text again?
source share