私は現在、ユーザー コントロールに取り組んでおり、依存オブジェクト クラス IsEnabled のカスタム プロパティが認識されますが、FooText は認識されません。
XAML:
<ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden"
sc:TouchScrolling.IsEnabled = "true"
Grid.Row="0" Grid.Column="1">
sc:TouchScrolling 要素にさらにプロパティを設定する必要がありますが、VS はプロパティが見つからないと文句を言い続けます。
TouchScrolling 要素は Dependency Object から継承します
public class TouchScrolling : DependencyObject
{
public bool IsEnabled
{
get { return (bool)GetValue(IsEnabledProperty); }
set { SetValue(IsEnabledProperty, value); }
}
public static readonly DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(TouchScrolling), new UIPropertyMetadata(false, IsEnabledChanged));
//FooText is not recognized
public string FooText
{
get { return (string)GetValue(FooTextProperty); }
set { SetValue(FooTextProperty, value); }
}