Here is my code:
public string Units
{
get { return (string)GetValue(UnitsProperty); }
set { SetValue(UnitsToolTipVisibility, Visibility.Visible);
SetValue(UnitsProperty, value); }
}
public static readonly DependencyProperty UnitsProperty = DependencyProperty.Register("Units", typeof(string), typeof(UserInputOutput));
public static readonly DependencyProperty UnitsToolTipVisibility = DependencyProperty.Register("UnitsToolTipVisibility", typeof(Visibility), typeof(UserInputOutput), new UIPropertyMetadata(Visibility.Visible));
My goal:
When the Units variable is Set I want the tooltip for this instance of the UserControl to become visible.
I think I’m going about this the wrong way. I have many, many instances of a UserControl. When an instance has the Units string set the tooltip for that instance should be visible.
It would be easier to just use a trigger in your XAML. You can get rid of the
UnitsToolTipVisibilityPropertycompletely then.