All Questions
Tagged with visibility wpf
50
questions
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 ...
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 ...
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>
<...
327
votes
4
answers
164k
views
Difference between Visibility.Collapsed and Visibility.Hidden
What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
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 ...
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?
13
votes
2
answers
32k
views
WPF Visibility of a UI element based on combo selection
Trying to show a label only when a certain item in a combo is selected. Code should pretty much explain it.
<ComboBox Name="comboMyCombo">
<ComboBoxItem>Don't show the label&...
17
votes
2
answers
7k
views
MVVM - hiding a control when bound property is not present
I was wondering if it is possible to hide a control on a view if the property to which the control is bound does not exist in the view model. For example, if I have the following:
<CheckBox ...
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>
<...
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 ...
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="...
15
votes
2
answers
45k
views
Get datagrid rows
How can I get the list of rows in the DataGrid? Not the bound items, but the
DataGridRows list.
I need to control the visibility of these rows and it's only possible to control it as a DataGridRow ...