I've created a DependencyProperty on my derived AutoCompleteBox control --> IsReadOnly
From there, I'm trying to set the value (T/F) via a converter. Based on the converter value, I would like to update the nested TextBox style in the setter of the DependencyProperty. Explicitly setting the property in the XAML (IsReadOnly="True") works fine, and the setter fires and updates the style. However, doing this via the converter does NOT fire of the setter of the DependencyProperty. I seem to be having trouble pasting code snippets here (first time poster).. so I'll do my best to give an quick code run through:
Property on AutoCompleteBox:
IsReadOnly="{Binding Converter={StaticResource IsReadOnlyVerifier}, ConverterParameter='Edit Client'}"
Which calls out to the Converter, which returns either true or false based on the User's permissions. This however does not call the setter of the registered DependencyProperty.
.. set
{
if (value)
{
var style = StyleController.FindResource("ReadOnlyTextBox") as Style;
TextBoxStyle = style;
}
else
{
TextBoxStyle = null;
}
SetValue(IsReadOnlyProperty, value);
}