Open FrancoisM opened 4 years ago
Note: the following does work as well so the issue is not with RelativeSource={RelativeSource Self}:
<custom:TabView>
<custom:TabView.Items>
<custom:TabViewItem Header="Info">
<StackPanel>
<TextBox Header="Nom" Text="{Binding Nom, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Background="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource TestConverter}}"/>
<Button Content="OK"/>
</StackPanel>
</custom:TabViewItem>
</custom:TabView.Items>
</custom:TabView>
public class TestConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language) => ((string)value).Length >2 ? new SolidColorBrush(Colors.PaleGreen) : new SolidColorBrush(Colors.OrangeRed);
public object ConvertBack(object value, Type targetType, object parameter, string language) => throw new NotImplementedException();
}
Thanks! On which platform do you see this behavior ?
Sorry, forgot to mention it's on wasm.
this alone in a page works:
but put into a
TabViewItem
and theTextBoxRegex
stops working:with:
private string NomRegex { get; } ="^.{2,}$";