public static readonly DependencyProperty SingleGridLengthProperty = DependencyProperty.Register("SingleGridLength", typeof(double), typeof(MapConverter));
public class MapConverter : DependencyObject, INotifyPropertyChanged, IMultiValueConverter
{
public double SingleGridLength
{
get { return (double)GetValue(MapConverter.SingleGridLengthProperty); }
set
{
SetValue(MapConverter.SingleGridLengthProperty, value);
OnNotifyPropertyChanged("SingleGridLength");
}
}
<local:MapConverter x:Key="MapConverter"
SingleGridLength="{Binding SingleGridLength, RelativeSource={RelativeSource Self}}" />
我有一組中的.xaml依賴項屬性:獲取而不是設置
我有每天屬性「漸」和返回值,但它的問題必然依賴屬性的轉換器從不「設置」價值。我可以在轉換器中使用依賴項屬性嗎?或者我應該以不同的方式來處理這個問題?提前致謝!