Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to Bind EventArgs and Command Parrameter to Command Event?

$
0
0

How to bind EventArgs and Command Parameter both together to a Command Event.

xmlns:cmd="http://www.galasoft.ch/mvvmlight"

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

<i:Interaction.Triggers>

<i:EventTriggerEventName="SelectionChanged"><cmd:EventToCommandCommand="{Binding SelectionChangedCommand}"PassEventArgsToCommand="True"

CommandParameter="Parameter"/>

</i:EventTrigger></i:Interaction.Triggers>

private RelayCommand<object> _selectionChanged;
        public RelayCommand<object> SelectionChanged
        {
            get
            {
                return _selectionChanged
                  ?? (_selectionChanged = new RelayCommand<object>(
                    async (_userTypeString) =>
                    {
                    });
            }
        }

This is my code. In my View Model on command action, I am getting only the Command Parameter and not the Event Args. How to get both of them together ?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>