I have “Service” custom control that doesn’t need to be visual. I just add it to my view so it can bind to VM and perform some functionality.
Style looks like so:
<Style TargetType="controls:IdattInteractions">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:IdattInteractions">
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
When view initialized I don’t get OnApplyTemplate called on my control. Is that because ControlTemplate empty? How do I achieve functionality I need? I need to proble visual tree around this control for some functionality and I wanted to do it inside OnApplyTemplate.
How should I go about this?
As far as I know, if your “control” is not visual, then it should be a business logic object of some class, running in memory and interacting with the ViewModel if needed. No need to declare it in XAML.