Skip to content

Instantly share code, notes, and snippets.

@luidgigromat
Last active January 26, 2021 16:13
Show Gist options
  • Save luidgigromat/781252c82d06bdb902573217f6b8d1c4 to your computer and use it in GitHub Desktop.
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]
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
<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