.NET/C#/WPF noob here. I’m trying to give a textbox a border based on a variable I can bind to (variable stores results of validation). My first attempt looked like this:
<Border ... Visibility="{Binding ServerName.IsValid, Converter={StaticResource BoolToVisibility}}">
<TextBox ... />
</Border>
But this had the undesired side effect of hiding the textbox within it when visibility was hidden. After that I looked at DataTriggers, but it didn’t seem like what I needed. Any ideas on how I can bind the border to that variable?
Thanks!
You can layer it:
(You can also overlay the border by switching the order if that is preferable)
You could use a
DataTriggeras well but you would need to change the appearance rather than hiding it completely.