Skip to main content

All Questions

Tagged with
327 votes
4 answers
164k views

Difference between Visibility.Collapsed and Visibility.Hidden

What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
Sauron's user avatar
  • 16.8k
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> <...
Timothy Khouri's user avatar
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 ...
user avatar
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}" ...
ygoe's user avatar
  • 19.8k
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 ...
Trap's user avatar
  • 12.3k
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" ...
7zawel's user avatar
  • 383
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?
David Ward's user avatar
  • 3,799
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> <...
sebi's user avatar
  • 431
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 ...
CBreeze's user avatar
  • 2,945
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 ...
c95mbq's user avatar
  • 584
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 ...
Aran Mulholland's user avatar
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. ...
empo's user avatar
  • 1,163
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 ...
italianogrosso's user avatar
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=...
Joseph jun. Melettukunnel's user avatar
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="...
Jonathan Allen's user avatar

15 30 50 per page
1
2 3 4 5
20