All Questions
Tagged with visibility wpf
291
questions
327
votes
4
answers
164k
views
Difference between Visibility.Collapsed and Visibility.Hidden
What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
192
votes
12
answers
197k
views
DataTrigger where value is NOT null?
I know that I can make a setter that checks to see if a value is NULL and do something. Example:
<TextBlock>
<TextBlock.Style>
<Style>
<Style.Triggers>
<...
171
votes
18
answers
125k
views
How do I invert BooleanToVisibilityConverter?
I'm using a BooleanToVisibilityConverter in WPF to bind the Visibility property of a control to a Boolean. This works fine, but I'd like one of the controls to hide if the boolean is true, and show if ...
99
votes
4
answers
66k
views
Binding Visibility for DataGridColumn in WPF
How can I hide a column in a WPF DataGrid through a Binding?
This is what I did:
<DataGridTextColumn Header="Column header"
Binding="{Binding ColumnValue}"
...
72
votes
4
answers
60k
views
In WPF, how can I determine whether a control is visible to the user?
I'm displaying a very big tree with a lot of items in it. Each of these items shows information to the user through its associated UserControl control, and this information has to be updated every 250 ...
34
votes
6
answers
121k
views
Bind visibility property to a variable
I have a Border with Label inside a Window,
<Border x:Name="Border1" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="21" Margin="229,164,0,0" VerticalAlignment="Top" ...
32
votes
4
answers
33k
views
WPF Tooltip Visibility
How can I ensure that a button's Tooltip is only visible when the button is disabled?
What can I bind the tooltip's visibility to?
31
votes
5
answers
63k
views
Dynamically toggle visibility of WPF grid column from C# code
My problem is: I can't find out how to toggle the visibility of my WPF grid column. Assume following XAML markup:
<Grid x:Name="myGrid">
<Grid.RowDefinitions>
<...
30
votes
3
answers
28k
views
MultiDataTrigger with OR instead of AND
I am trying to set multiple DataTriggers on my Button. I did some research and found that MultiDataTrigger allows you to do this. I want the Visibility property of my Button to be set to false if the ...
25
votes
3
answers
23k
views
WPF - hiding listbox items
I have a listbox where the itemtemplate is using a style. The styles specifies a border with a datatrigger setting the visibility of the border to collapsed depending on a property. This works fine ...
25
votes
5
answers
8k
views
WPF: Stop Binding if a UI element is not visible
Can I delay binding of a ui element if the element is not currently visible. Sometimes I have a form that has some hidden/minimised elements, I would like to not update them if they are not on the ...
23
votes
1
answer
13k
views
WPF - How do I default the Visibility of a databound Textblock?
This Textblock, defined below, shows when the window first loads because it has no Datacontext (and hence the converter code is not run) until an item has been selected from another control e.g. ...
19
votes
4
answers
13k
views
MVVM pattern violation: MediaElement.Play()
I understand that ViewModel shouldn't have any knowledge of View, but how can I call MediaElement.Play() method from ViewModel, other than having a reference to View (or directly to MediaElement) in ...
19
votes
7
answers
40k
views
C#/WPF: Make a GridViewColumn Visible=false?
Is there an option to hide a GridViewColumn somehow like this:
<ListView.View>
<GridView>
<GridViewColumn Header="Test" IsVisible="{Binding Path=...
18
votes
5
answers
25k
views
WPF: Binding Visibility by string contents
Ok, so here is my XAML:
<TextBlock Text="{Binding Path=InstanceName}"></TextBlock>
If InstanceName is null or an empty string, I want Visibility="Collapsed". Otherwise I want Visibility="...