DataContext como fuente para el convertidor de unión dentro de los recursos
<Canvas.DataContext>
<ViewModels:VMSomeControl Model="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
</Canvas.DataContext>
<!-- DataContext is not passed into these Instances.
they also have no knowledge of their TemplatedParent. -->
<Canvas.Resources>
<!-- is there a way to use a binding that points to the datacontext within the resources ? -->
<Converters:SomeConverter x:Key="someConverter"
SomeProperty="{Binding Path=Model.SomeProperty}" />
<!-- is there a way to point Directly to the TemplatedParent ? -->
<Converters:SomeConverter x:Key="someConverter"
SomeProperty="{TemplateBinding SomeProperty}" />
</Canvas.Resources>
<SomeFrameworkElement SomeProperty="{Binding Path=Model.SomeOtherProperty, Converter={StaticResource someConverter}, ConverterParameter=0}" />
<SomeFrameworkElement SomeProperty="{Binding Path=Model.SomeOtherProperty, Converter={StaticResource someConverter}, ConverterParameter=1}" />
</Canvas>
es posible el uso de enlaces que utilizan ya sea el DataContext o la TemplatedParent Dentro Visuales raíz resourecs de un ControlTemplate ?
por alguna razón stackoverflow truncó mi plantilla de estilo y control. este lienzo está en la raíz de la plantilla de control. –