RadioButton.Checked Error: Control.Checked cannot appear on the left hand side of += or -=

前端 未结 3 1044
北荒
北荒 2021-01-06 17:21

I am having the strangest problem, and I have to be missing something.

Here is my code that is causing the error.

if (radLot.Checked == true)
{
    S         


        
3条回答
  •  一整个雨季
    2021-01-06 18:12

    Checked is the name of the event that is raised when a ToggleButton is checked. (The RadioButton class derives from ToggleButton.)

    I assume you want to access the IsChecked property, which gets (or sets) whether the ToggleButton is checked.

    if (radLot.IsChecked == true)
    {
        SymbolSpecification = "LotRenderer";
    }
    

    Hint: Most boolean properties related to the visual state start with Is— in WPF.

提交回复
热议问题