XAML文档基础

XAML文档中的每个元素都映射为.NET类的一个实例。元素的名称也完全对应于类名。如元素<Button>指示WPF创建一个Button对象。

XAML名称空间

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

引入第三方库时语法:xmlns:local="clr-namespace:DotNet.WpfControl;assembly=DotNet.WpfControl"

其中:clr-namespace表示命名空间。assembly表示程序集DLL

原文地址:https://www.cnblogs.com/lihuali/p/7511065.html