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.
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.
I suggest using ListBox with TextBlock as ListBox.ItemTemplate and WrapPanel as ListBox.ItemsPanel.
You can also highlight the ListBox current selected item.
Related
I have created this graph in the c3 chart. I want to identify the red circle highlighted in the attached image. Is there any way in c3 chart which help to identify all the intersection points? So that I can add any label? So if the c3 chart provides any such method please help me. Thanks in advance
I just want to implement it like the below-attached screenshot. See here the green and pink circles. Once intersection points are identified the labels are added
I am using Livecharts in wpf to generate a multiple line chart. The number of lines can be varied from 1 to 30.
For now, I have added a default tooltip which displays all the y-axis values of the current x-axis position where cursor is hovered. So when I have 36 lines in the chart, a larger tooltip is displayed and it does look bad.
So, can I know whether there is any approach which we can enable the tooltip only when the number of lines is lesser that 10 (for an example) and disable when it is above 10?
Thank you!
I have two containers on a layered layout say c1 and c2.
c1 has a lot of buttons, drag n drop etc.
c2 has a translucent background for the entire screen with a centre aligned image and a close button.
I need to be able to automatically disable all actions for c1 when c2 is added over c1.
While I can handle this programatically when c2 is added over c1 during runtime, it would great to automatically disable all events for c1.
Is there a better way to handle this ?
Thanks
I think making the top layer focusable should grab the events from the underlying component. Haven't tested it though.
I want to create a slider, with values from 0 to 100 that I can slide like any other slider... but at position 30, 42 and 55 (for example) I want to snap to these values, to make easy to the user to stop the slider at them
edit: my solution was to have 2 slider, the first one is invisible, value 0 to 200, and the other one is the visible on, value 0 to 100
The visible one cannot be slide, only the the invisible. Like this i can make a gap, ex: when I'm between 50 and 75 on the invisible slider, it's equals to 50 on the visible one...
You have to override OnValueChanged. See this article DiscreteSlider - Adding Functionality with a Simple Control Subclass and then this artice Silverlight slider control that snaps for a detailed explanation.
Instead of using SmallChange, you would check where between your values the slider sits and snap to the nearest.
I have a user control that has a white background with a Zindex = 0. I also have an image on top of the white background with a Zindex = 10. When I use planeprojection to flip the image 180 degrees on the X-axis it just shows my image in reverse. How would I get it to show the white background when it gets flipped?
PlaneProjection inherently won't show the "back side" of a container. What you need to do:
Define two elements in your container: one for the front/visible side and one for the back/hidden side
When your PlaneProjection rotation is greater than 90 degrees, hide the front element, and show the back element. Vice-versa for switching back to < 90 degrees
I believe you can use the VisualStateManager to intercept when the rotation angle hits a certain value and to then apply the visibility.
Here is a Tim Heurer article on the VSM:
http://timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx