最終更新:2016-02-18 (木) 20:47:53 (2988d)
XAML/名前空間
XAML 名前空間および WPF XAML の名前空間の割り当て
規定の名前空間
- x: プレフィックスの割り当てによって XAML 言語定義の一部である組み込みをサポートし、WPF は XAML を言語として使用する 1 つの実装として、そのオブジェクトの XAML での語彙を定義するという位置付けになります。
- WPF 語彙の使用は XAML 組み込みの使用に比べてはるかに一般的であるため、WPF 語彙が既定として割り当てられます。
xmlns
- http://schemas.microsoft.com/winfx/2006/xaml/presentation
- WPFクライアント/フレームワークのXAML名前空間
xmlns:x
例
<Window x:Class="WpfApplication1.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:WpfApplication1" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"> <Grid> </Grid> </Window>
関連
- x:Class?
- 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
- mc:Ignorable?="d"
例
<?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://schemas.microsoft.com/winfx/2006/xaml" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <!-- Root element attributes --> <xs:attribute name="Class" type="frlrfSystemStringClassTopic" /> <xs:attribute name="Subclass" type="frlrfSystemStringClassTopic" /> <xs:attribute name="TypeArguments" type="frlrfSystemStringClassTopic" /> <!-- Attributes for things inside of a resource dictionary --> <xs:attribute name="Key" type="frlrfSystemStringClassTopic" /> <!-- Attributes on any object tag --> <xs:attribute name="Name" type="frlrfSystemStringClassTopic" /> <xs:attribute name="Language" type="frlrfSystemStringClassTopic" /> <!-- Elements --> <xs:element name="Code" type="dCode" /> <xs:element name="XData" type="dXData" /> <xs:complexType name="dCode" mixed="true"> <xs:attribute name="Source" type="frlrfSystemStringClassTopic" /> <xs:attribute name="Type" type="frlrfSystemStringClassTopic" /> </xs:complexType> <xs:complexType name="dXData" mixed="false"> <xs:choice minOccurs="1" maxOccurs="1"> <xs:any processContents="skip" /> </xs:choice> </xs:complexType> <xs:simpleType name="frlrfSystemStringClassTopic" > <xs:restriction base="xs:string" /> </xs:simpleType> </xs:schema>