开发者

Silverlight Conditional CheckBox/RadioButton

Imagine I had a list of names, each paired with a value ("C" for CheckBox or "R" for RadioButton).

Can I put together a template to display the correct control based on the given value?

For instance if I have "Name0, C" I'd like to display a CheckBox labeled Name0. If I have "Name1, R" I'd like to display a RadioButton labeled Name1.

Any ideas? Or is this even possible using only a template? Perhaps I would need to make the determi开发者_如何学运维nation in the code-behind?


Perhaps you could use a data template that has both a Checkbox and RadioButton. You could then create a type converter for ValueToVisability to display one and hide the other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜