Skip to main content

All Questions

Tagged with
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 ...
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 ...
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=...
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 ...
2 votes
3 answers
750 views

WPF change visibility based on Items in Observable-Collection

I have the Following Collection: ObservableCollection<CheckedFileObject> Files A CheckedFileObject contains a FileObject and a bool isChecked. Now when a user selects a File the isChecked Value ...
3 votes
4 answers
12k views

How to hide Grid border

I have a grid with some controls inside. I want to hide the grid border. Are there any specific properties which can be used to hide the grid border in WPF?
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}" ...
327 votes
4 answers
164k views

Difference between Visibility.Collapsed and Visibility.Hidden

What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
0 votes
1 answer
322 views

Make element visible when Validation.HasError is true

I have the following xaml markup: <GroupBox Margin="10" Padding="20" Header="Case 5 - Custom Error Object"> <GroupBox.DataContext> ...
0 votes
2 answers
2k views

wpf toggling visibility collapse only works once

What i want to do is collapse the bottom section of the WPF ui based on the checkbox toggle. This mostly works as expected so far. Below as you step through the images you'll see the collapse stops ...
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 ...
3 votes
2 answers
842 views

WPF Change Visibility during design-time

My CustomControls UI element Visibility is bound through a BoolToVisibilityConverter, see code below : <cc:CustomFFU LabelText="FFUZoneF_2-1" HorizontalAlignment="Center" ...
-1 votes
2 answers
266 views

Hide a control with trigger on another

I have a <TextBlock x:Key="_tb1"/> and another <TextBlock x:Key="_tb2"/>. How to set visibility of _tb1 when for exemple IsMouseOver of _tb2 is true ?
1 vote
1 answer
372 views

WPF - Virtualization does not work for items with collapsed visibility

I have performance problem with my listview. There is a WPF ListView with groupping and virtualisation. <ListView Name="ListOfEvents" SelectionMode="Extended" ...
9 votes
6 answers
18k views

How to collapse a RowDefinition?

I need to remove the space occupied by a Grid.Row. I am able to collapse (remove) the control I have placed in Grid.Row, but since RowDefinition has fixed size (height) even after removing the child ...

15 30 50 per page
1
2 3 4 5
20