[C#/WPF] behind cs 코드에서 Command 호출하기 (StringToCommand)


[C#/WPF] behind cs 코드에서 Command 호출하기 (StringToCommand)

Xaml의 페이지 내에 컨트롤의 개수가 많아 Command를 무척 많이 추가해야 할 경우, ViewModel 페이지에 Command로 지져분해질 수 있습니다. 이럴 경우, ViewModel에서는 하나의 Command만 생성하고, Param을 구분해서 사용하면 편하게 사용가능합니다. StringToCommand Class public static class StringToCommand { /// /// dataContext를 command로 보내기 /// public static void Execute(object dataContext, string command) { StringToCommand.Execute(dataContext, command, null); } /// /// dataContext를 ..


원문링크 : [C#/WPF] behind cs 코드에서 Command 호출하기 (StringToCommand)