Is there a way to pass a parameter (or multiple params) to the CallMethodAction
behavior?
相关问题
- WPF Binding from System.Windows.SystemParameters.P
- Xamarin. The name 'authorEntry does not exist
- XAML: Applying styles to nested controls
- How to properly change a resource dictionary
- ObservableCollection in ViewModel is not updated w
相关文章
- WPF MVVMLight:在ViewModel中,开子线程为ObservableCollectio
- 关于ItemsControl的绑定问题
- XAML ComboBox SelectionChanged Fires OnLoad
- Show flyout using BottomAppBar
- Why does my ScrollViewer destroy my Grid Layout? W
- Can I add/subtract value that is bound to an eleme
- Best way to implement MVVM bindings (View <-> V
- How to overlay items in StackPanel or ListView?
Try InvokeCommandAction a command instead of using CallMethodAction:
Hope it helps
After some decompiling it turns out that
CallMethodAction
does support calling methods with parameters. However,CallMethodAction
is very strict on the expected signature. Methods must conform to the following:Where the args parameter can be a subclass of EventArgs, which therefore allows passing in (any number of) custom parameters. For instance:
Thus allowing for the following signature:
For reference, here's the code in CallMethodAction that performs the conformity check: