XAML Readerに無視されるプレフィックスを指定するmc:Ignorable属性
mc:Ignorable属性を使用して、XAML Readerに無視されるプレフィックスを指定することができます。
たとえば、下記のXAMLコードの場合、ignorablePrefixプリフィックスは無視されるためhogehogeと書いてもエラーにはなりません。
XAML
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ignorablePrefix="ignorableUri"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="ignorablePrefix">
<ignorablePrefix:hogehoge/>
</Page>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ignorablePrefix="ignorableUri"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="ignorablePrefix">
<ignorablePrefix:hogehoge/>
</Page>
この属性が何の役に立つかというと、Blendのようなデザイナの機能で使われているようです。たとえばBlendの[オブジェクトとタイムライン]にある目玉の形をしたアイコンをクリックすると、そのオブジェクトをデザイン上非表示にすることができます。この状態のXAMLを確認してみるとmc:Ignorableが使われていることが分かります。
XAML
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xml:lang="ja-JP"
x:Class="Window1"
x:Name="Window"
Title="Window"
Width="640" Height="480"
xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="LayoutRoot">
<Button Content="Button" d:IsHidden="True"/>
</Grid>
</Window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xml:lang="ja-JP"
x:Class="Window1"
x:Name="Window"
Title="Window"
Width="640" Height="480"
xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid x:Name="LayoutRoot">
<Button Content="Button" d:IsHidden="True"/>
</Grid>
</Window>
IsHiddenがTrueに指定されているオブジェクトはBlendのアートボード上では非表示となります。もちろん、実行時には無視されますので影響がありません。
他にも既定でBlendに付属しているSimple Stylesというコントロールのスタイルがありますが、このXAMLファイルでも使われています。
日本語版ベータ1 \Program Files\Microsoft Expression\Blend Beta 1\AppThemes\ja\Simple Styles.xaml 英語版RC \Program Files\Microsoft Expression\Blend 1.0\AppThemes\en\Simple Styles.xaml
<!-- Simple Repeat Button - This is used by Simple ScrollBar for the up and down buttons -->
<Style x:Key="SimpleRepeatButton" d:IsControlPart="True" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
<Style x:Key="SimpleRepeatButton" d:IsControlPart="True" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
IsControlPartがTrueと指定されているオブジェクトは、Asset libraryのコントロール一覧に表示されません。