728x90
xaml
<CheckBox Command="{Binding SelfTestCommand}" CommandParameter="{Binding RelativeSource={RelativeSource self}, Path=IsChecked}"/> |
cs
private DelegateCommand<bool?> selfTestCommand; /// <summary> /// SelfTest Command /// </summary> public ICommand SelfTestCommand { get { if (this.selfTestCommand== null) { this.selfTestCommand= new DelegateCommand<bool?>((param) => OnSelfTestCommand(param)); } return this.selfTestCommand; } } private void OnFalseCallCommand(bool? isChecked) { } |
728x90
'C# > WPF' 카테고리의 다른 글
[WPF] AvalonEdit (ICSharpCode) 을 이용해 코드 표현하기 (0) | 2022.05.11 |
---|---|
[WPF/DevExpress] DXSplashScreen TopMost=False 처리 (0) | 2022.04.25 |
[WPF] StringFormat 으로 소수점 세자리 표시 및 문자열 넣기 (0) | 2022.04.18 |
[WPF] ComboBox Command Binding 하기 (0) | 2022.04.15 |
[WPF] Action 비동기 수행하기 (0) | 2022.04.01 |