Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF commanding

$
0
0

I'm hoping someone can help me with the below problem. I have a dynamically generated list of radio buttoms in a user coltrol. when I select a radio button a string containing a name of the radio button is passed as a parameter to Execute metod below and an error is generated.

[DebuggerStepThrough]
        public Boolean CanExecute(Object parameter)
        {
            return _canExecute == null ? true : _canExecute((T)parameter);
        }
        public void Execute(Object parameter)
        {
            _execute((T)parameter);
        }

<DataTemplate DataType="{x:Type sys:String}" x:Key="RadioButtons"><RadioButton Margin="0,3" Content="{Binding .}" GroupName="radios" 
                Command="{Binding ElementName=ItemOptionList, Path=DataContext.ViewInstrumentOptionCommand}"
                         CommandParameter="{Binding}"
                         /></DataTemplate>

Thanks in advance,

wesley


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>