UWPアプリを開発していて、新しいユーザーコントロールを作成しました。コントロールのコードの後ろに(データコンテキストなしで)依存プロパティにバインドしたいと思います。背後にUWPコントロールをコードビハインドプロパティにバインドする
コード:
public Brush Fill
{
get { return (Brush)GetValue(FillProperty); }
set { SetValue(FillProperty, value); }
}
// Using a DependencyProperty as the backing store for Fill. This enables animation, styling, binding, etc...
public static readonly DependencyProperty FillProperty =
DependencyProperty.Register("Fill", typeof(Brush), typeof(MyControl), new PropertyMetadata(new SolidColorBrush(Colors.Black)));
XAML:私は私の道のfillプロパティは、背後にあるコードからプロパティFill
に結合し、私ができるように、(データコンテキストが異なるデータを保持する必要があることを望ん
...
<Grid>
<Path Fill="{Binding ????}" Stretch="Fill">
...
</Path>
</Grid>
ここで使用しないでください)
UWPでどうすればいいですか?