でレンダリングされていないしかし、そのカスタムコントロールはメインページにレンダリングされていません。私は何を間違えたの?カスタムコントロールは、私がリンク</p> <p><a href="http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control" rel="nofollow">http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control</a></p> <p>を追った私はWP7.1でWatermarkTextBoxを作成したいWP7.1
WaterMarkTextBox.cs
public class WaterMarkTextBox : TextBox
{
public WaterMarkTextBox()
{
DefaultStyleKey = typeof(WaterMarkTextBox);
}
}
WaterMarkTextBoxStyle.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
xmlns:local="clr-namespace:MyCustomControls">
<Style TargetType="local:WaterMarkTextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:WaterMarkTextBox">
<Grid>
<Border>
<ContentControl x:Name="ContentTextBox" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
サンプル:ローカル= "CLR名前空間:
は、以下
のxmlns含まMyCustomControlsと、アセンブリ= MyCustomControls "