<ValidationProperty("Checked")>
Public Class YesNoPicker
    Inherits System.Web.UI.UserControl

#Region "Properties"

    Property Checked As Boolean?
        Get
            Select Case rbAnswer.SelectedIndex
                Case 0 : Return True
                Case 1 : Return False
                Case Else : Return Nothing
            End Select
        End Get
        Set(value As Boolean?)
            rbAnswer.SelectedIndex = If(value.HasValue, If(value.Value = True, 0, 1), -1)
        End Set
    End Property

    Property Enabled As Boolean
        Get
            Return rbAnswer.Enabled
        End Get
        Set(value As Boolean)
            rbAnswer.Enabled = value
        End Set
    End Property

    Property UndefinedValue As Boolean
        Get
            Return rbAnswer.Attributes("data-undefined")
        End Get
        Set(value As Boolean)
            rbAnswer.Attributes("data-undefined") = value
        End Set
    End Property

#End Region

#Region "hacks"

    Overrides ReadOnly Property ClientID As String
        Get
            Return rbAnswer.ClientID
        End Get
    End Property

#End Region

End Class