For a view, there are corresponding .xaml and a .xaml.cs files. How are these files related?
I\'m super new to xaml - I think I see dynamic placeholders in the .xaml fil
.xaml is the designer file and .xaml.cs is the code-behind file where you write the business logic instead of inline code in .xaml. This provides more flexiblity of code separation and code readability.
For an application using a MVVM (Model View ModelView) implementation:
The XAML file (.xaml) and the corresponding code-behind file (.xaml.cs) are two partial definitions of the same class.
Partial Classes and Methods (C# Programming Guide): https://msdn.microsoft.com/en-us/library/wa80x488.aspx
The InitializeComponent() method that is called in the constructor of the code-behind class at runtime locates a URI to the compiled XAML file and passes it to a LoadComponent() method that parses the BAML, i.e. the compiled XAML, and creates instances of the elements that you have defined in your XAML markup. Please refer to the following link for more information about this.
What does InitializeComponent() do, and how does it work in WPF?