Home > Enterprise >  WPF - best control to show chess moves?
WPF - best control to show chess moves?

Time:06-28

What kind of WPF text control would be best to display the moves of a chess game? Ideally the clicked move would highlight in bold. Example text below. Each move should be clickable, should highlight when clicked (e.g. Bxf6) and would call some code to action the move.

  1. d4 Nf6 2. Bg5 d5 3. Bxf6 gxf6 4. Nf3 Nc6 5. e3 Bg4 6. Be2 e5 7. c3 Qd7 8. Nbd2 O-O-O 9. Qa4 e4 10. Ng1 Bxe2 11. Nxe2 Qg4 12. g3 h5 13. h3 Qf5 14. h4 Kb8

Thanks.

CodePudding user response:

I suggest using ListBox with TextBlock as ListBox.ItemTemplate and WrapPanel as ListBox.ItemsPanel.

You can also highlight the ListBox current selected item.

  • Related