Search code examples
c#xamluser-interfaceuwpwinui

Is there an equivalent WPF's Visibility.Hidden property in UWP?


From Microsoft's documentation in WPF the Visibility enum has three values, Visible, Hidden, Collapsed.

UWP is missing the Hidden property, which hides a control, but the space for that control is reserved.

Is there an equivalent WPF's Visibility.Hidden property in UWP?


Solution

  • In UWP, there is no direct hidden function like what you did in WPF. A possible way is to use the UIElement.Opacity Property. You could set the Opacity as 0.

    But remember that the control is still able to response to the user since it is not really hiding. So you need to set the IsEnabled property to false as well.