What is the difference between the hidden attribute (HTML5) and the display:none rule (CSS)?

The key difference seems to be that hidden elements are always hidden regardless of the presentation: The hidden attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely … Read more

How do I invert BooleanToVisibilityConverter?

Instead of inverting, you can achieve the same goal by using a generic IValueConverter implementation that can convert a Boolean value to configurable target values for true and false. Below is one such implementation: public class BooleanConverter<T> : IValueConverter { public BooleanConverter(T trueValue, T falseValue) { True = trueValue; False = falseValue; } public T … Read more

DataTrigger where value is NOT null?

This is a bit of a cheat but I just set a default style and then overrode it using a DataTrigger if the value is null… <Style> <!– Highlight for Reviewed (Default) –> <Setter Property=”Control.Background” Value=”PaleGreen” /> <Style.Triggers> <!– Highlight for Not Reviewed –> <DataTrigger Binding=”{Binding Path=REVIEWEDBY}” Value=”{x:Null}”> <Setter Property=”Control.Background” Value=”LightIndianRed” /> </DataTrigger> </Style.Triggers> </Style>

Difference between Visibility.Collapsed and Visibility.Hidden

The difference is that Visibility.Hidden hides the control, but reserves the space it occupies in the layout. So it renders whitespace instead of the control. Visibilty.Collapsed does not render the control and does not reserve the whitespace. The space the control would take is ‘collapsed’, hence the name. The exact text from the MSDN: Collapsed: … Read more

Equivalent of jQuery .hide() to set visibility: hidden

You could make your own plugins. jQuery.fn.visible = function() { return this.css(‘visibility’, ‘visible’); }; jQuery.fn.invisible = function() { return this.css(‘visibility’, ‘hidden’); }; jQuery.fn.visibilityToggle = function() { return this.css(‘visibility’, function(i, visibility) { return (visibility == ‘visible’) ? ‘hidden’ : ‘visible’; }); }; If you want to overload the original jQuery toggle(), which I don’t recommend… !(function($) … Read more