XML is case sensitive, so <Button> and <button> are different tags.
All tags must be closed, either with a closing tag or self-closing tag. for example, <Button></Button> and <Button /> are valid, but <Button> is not valid.
All attributes must be quoted, either with single or double quotes. For example, <Button Content="Click Me" /> is valid, but <Button Content=Click Me /> is not valid.
XML have only one root tag, so you can have only one top level tag. For example, <Button /><TextBlock /> is not valid, but <StackPanel><Button /><TextBlock /></StackPanel> is valid.
XML is hierarchical, so you can have nested tags. For example, <Button><TextBlock Text="Click Me" /></Button> is valid
Close tag without children
For tag without children you can use either of the following syntax
<!-- Open and Close tag --><ButtonContent="Click Me"></Button>
<!-- Self Closing tag --><ButtonContent="Click Me"/>
This is more readable and preferred way to write XML tag without children
Close tag with children
You must follow this syntax to close tag with children
WPF uses XML namespaces to differentiate between different types of controls and elements. For example, the Button control is defined in the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace, while the TextBlock control is defined in the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace.
If namespaces are wrong, controls may not be recognized.
Sample WPF Form
<Windowx:Class="WpfApp.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfApp"mc:Ignorable="d"Title="MainWindow"Height="450"Width="800"><Grid><Grid.ColumnDefinitions><ColumnDefinitionWidth="*"/><ColumnDefinitionWidth="200"/></Grid.ColumnDefinitions><!-- Add Stack Panel in first column --><StackPanelGrid.Column="0"Background="White"><!-- Add List View with 3 columns --><TextBlockName="NameTextBlock"Text="Name"FontWeight="Bold"Margin="10"/><TextBoxName="NameTextBox"Margin="10"/><TextBlockName="AgeTextBlock"Text="Age"FontWeight="Bold"Margin="10"/><TextBoxName="AgeTextBox"Margin="10"/><TextBlockName="BalanceTextBlock"Text="Balance"FontWeight="Bold"Margin="10"/><TextBoxName="BalanceTextBox"Margin="10"/></StackPanel><!-- Add Stack Panel in second column --><StackPanelGrid.Column="1"Background="LightGray"><ButtonName="RunButton"Content="Run"Click="RunButton_Click"Margin="10"/></StackPanel></Grid></Window>