I'm modifying an existing WPF project at work (I don't have much experience with WPF), and I have this property:
public Point WidgetMiddlePoint
{
get
{
return new PointByAppMonitorDPI(_middlePoint);
//return _middlePoint;
}
}
And this at the UI side:
<controls1:BorderWithTip.TipOffset>
<MultiBinding Converter="{StaticResource TipOffsetPositionConverter}">
<Binding Path="WidgetMiddlePoint" Delay="500" NotifyOnSourceUpdated="False" NotifyOnTargetUpdated="False"/>
<Binding ElementName="BorderWithTip" Path="ActualWidth" Delay="500" NotifyOnSourceUpdated="False" NotifyOnTargetUpdated="False"/>
</MultiBinding>
</controls1:BorderWithTip.TipOffset>
The TipOffsetPositionConverter performs some calculations based on the given parameters.
My problem is that the WidgetMiddlePoint value depends on the DPI of the monitor in which the app resides (the DPI isn't relevant for my question, it's just a use case for a factor that is taken into account only when calling the getter).
So what happens is that the UI takes the value from the getter and won't refresh that value unless I use the setter to set it to something else, and then 'notify'.
How can I configure the UI to re-get the value every time, even when it 'thinks' that the property's value hasn't changed? Or is it bad practice and not recommended?