Last active
January 26, 2021 16:13
-
-
Save luidgigromat/781252c82d06bdb902573217f6b8d1c4 to your computer and use it in GitHub Desktop.
Proxy control used has static ressource for allow Path/Geometry... childs binding [VB.NET]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class BindingProxy | |
Inherits Freezable | |
Protected Overrides Function CreateInstanceCore() As Freezable | |
Return New BindingProxy() | |
End Function | |
Public Property Data As Object | |
Get | |
Return DirectCast(GetValue(DataProperty), Object) | |
End Get | |
Set | |
SetValue(DataProperty, Value) | |
End Set | |
End Property | |
'Using a DependencyProperty as the backing store for Data. This enables animation, styling, binding, etc... | |
Public Shared ReadOnly DataProperty As DependencyProperty = | |
DependencyProperty.Register("Data", GetType(Object), GetType(BindingProxy), New UIPropertyMetadata(Nothing)) | |
End Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Canvas> | |
<Canvas.Resources> | |
<local:BindingProxy x:Key="ProxyControl" Data="{Binding YOUR_SVG_PATH_BINDING}" /> | |
</Canvas.Resources> | |
<Path Fill="#000000"> | |
<Path.Data> | |
<PathGeometry Figures="{Binding Source={StaticResource ProxyControl}, Path=Data}" /> | |
</Path.Data> | |
</Path> | |
</Canvas> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment