Yes, there is at least one other to do this. From your example, it makes no sense to use Command because you just want to send the value from the View to the ViewModel.
I suggest you use Messenger to send values ββbetween View and ViewModel. What you need to do:
1) Register the message in your ViewModel. I prefer to do this in my constructor. You must also add a method to handle the callback from the messenger. Please note that "tokenId" used to make sure that you are sending a message to subscribers.
Messenger.Default.Register<double>(this, YourMethodHere, "tokenId"); private void YourMethodHere(double value) {
2) Inside the view, you need to add an event to the button and just send a message through the messenger.
private void Button_Click(object sender, RoutedEventArgs e) { Messenger.Default.Send<double>(this.ActualWidth, "tokenId"); }
3) You can Unregister subscription to ViewModel in your destructor to prevent reciprocal sending of messages.
source share