D
D
Denis Antonenko2015-03-05 01:23:10
Windows phone
Denis Antonenko, 2015-03-05 01:23:10

How to correctly bind the Visibility of a button to the presence of objects in ListView.SelectedItems?

I started with a simple Win Phone 7 Silverlight application. I did everything as it turned out - no BestPractise, a lot of code behind. Now I switched to Win Phone 8 Store Application - paired with the MVVM pattern. I try to use only binding and commands.
There is a simple case: we have a list of elements with the ability to select several of them; button on the AppBar to remove the selected items. It is necessary to organize a simple behavior: if there are no selected elements, hide the button. But an attempt to solve this problem by binding on the ListView.SelectedItems property was not successful - it is read-only and cannot be used for binding.
Hence the question: is there a 'classical' solution for this situation?
(Is it possible to break everything down with XAML alone?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Zolotov, 2015-03-05
@SZolotov

Look towards converters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question