It exsists several way to reveal your need, following the use of combobox to select the type of command and a button to send the request:
Xaml
<Window x:Class="CommandNameSpace.Views.MainWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
<Grid x:Name="MainGrid">
<Canvas >
<StackPanel VerticalAlignment="Center">
<ComboBox ItemsSource="{Binding LisCommandType, Mode=TwoWay}" SelectedItem="{Binding SelectedCommandType, Mode=TwoWay}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<StackPanel VerticalAlignment="Center">
<Button x:Name="cmdCommand" IsDefault="True" Content="Commander" Command = "{Binding OrderCommand}" CommandParameter = "null"/>
</StackPanel>
</Canvas >
</Grid>
</Window >
Main Class
namespace CommandNameSpace
{
public class MainCalss
{
public BaseCommand<string> OrderCommand { get; private set; }
private Dictionary<string, string> _selectedCommandType = new Dictionary<string, string>();
private KeyValuePair<string, string> _selectedLanguage;
public ServicesControlViewModel()
{
OrderCommand = new BaseCommand<string>(cmdOrderCommand);
LisCommandType.Add("DrinkCommand", "Drink");
LisCommandType.Add("DrinkWithSugarCommand", "Drink With Sugar");
LisCommandType.Add("DrinkWithMilkCommand", "Drink With Milk");
LisCommandType.Add("DrinkWithSugarAndMilkCommand", "Drin kWith Sugar And Milk");
SelectedCommandType = new KeyValuePair<string, string>("DrinkCommand", "Drink");
}
public Dictionary<string, string> LisCommandType
{
get
{
return _liscommandType;
}
set
{
_liscommandType = value;
}
}
public KeyValuePair<string, string> SelectedCommandType
{
get
{
return _selectedCommandType;
}
set
{
_selectedCommandType = value;
}
}
private void cmdOrderCommand(string paramerter)
{
switch (SelectedCommandType)
{
case "DrinkCommand":
Instruction for DrinkCommand type
break;
case "DrinkWithSugarCommand":
Instruction for DrinkCommand type
break;
case "DrinkWithMilkCommand":
Instruction for DrinkCommand type
break;
case "DrinkWithSugarAndMilkCommand":
Instruction for DrinkCommand type
break;
}
}
}
Call Of View
MainCalss MainCl = new MainCalss();
MainWindowView MainV = new MainWindowView();
MainV.Datacontext = MainCl;
MainV.ShowDialog();
Cordialy