Replies: 1 comment 6 replies
-
|
The simple Example: public static class ExampleDataAp
{
public static readonly DependencyProperty DataProperty =
DependencyProperty.RegisterAttached("Data", typeof(FrameworkElement), typeof(ExampleDataAp),
new PropertyMetadata(false, OnDataChanged));
private static void OnDataChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
{
}
public static void SetData(UIElement element, FrameworkElement value)
{
element.SetValue(DataProperty, value);
}
public static FrameworkElement GetData(UIElement element)
{
return (FrameworkElement)element.GetValue(DataProperty);
}
} <ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="dragAPs:ExampleDataAp.Data" Value="{Binding ElementName=baseListView}"/>
</Style>
</ItemsControl.ItemContainerStyle>Error |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just wanna create attached property.
In the UWP I created attached property but this attached property does't work for NET6 pratfroms.
My xamlGenerator has issue for another platforms.
I readed Row attached property realization from Grid and also I Readed documentation. Its should be like next code:
But GeneratedDependencyPropertyAttribute it is internal sealed class.
How can I create my custom attached property?
Beta Was this translation helpful? Give feedback.
All reactions