I really like Caliburn and the naming convention binding and was surprised that the Visibility is not bound in the same way the "CanNAME" Convention is used to guard an Action. As far as I know is the BooleanToVisibilityConverter only used when Binding is explicitly used in Caliburn and not automatically like the guard method. So I was thinking to modify the source to bind automatically to "bool? ControlNameIsVisible()" (null equals collapse) or similar. I was wondering if that is the right approach and if soo if somebody has done the implementation already and could share it here.
相关问题
- How can I get the binding from method_missing?
- Symfony form values missing
- Binding with dictionary item by key
- Model binding of nested properties in asp.net core
- Durandal Compose: activate method not always calle
相关文章
- Using relative path in assemblyBindig/linkedConfig
- Should I keep bad naming conventions?
- WPF: Binding List to ListBox
- How can I display my user control in the MainWindo
- Attach scroll event to div with body on() binding
- F# naming convention
- coding style checker for c (variable names, not in
- Quickly create dependency properties in VS
You could use this approach if you wanted, it's perfectly reasonable. Another approach is to use a Border with the same name as a boolean property on your view model. Caliburn.Micro will set the visibility of the Border based on the value of the boolean property.
If you want a general solution, this is what I ended up with, based on: Adding a convention for IsEnabled to Caliburn.Micro
Note the overriding of BindActions as well as BindProperties so that you can check for Visibility on things that have actions bound to them.