I draw UI using WPF and MVVM. Using
<Button Name="priceButton" Content="Прайс" Command="{Binding GetPricesCom}" HorizontalAlignment="Left" Margin="339,513,0,0" VerticalAlignment="Top" Width="125" Height="31" Click="priceButton_Click"/> The method is called when the program is started, and not when the button is pressed. How to implement ICommand so that it is called only when a button is pressed.
public ICommand GetPricesCom { get { GetPrices(); return GetPricesCom; } }