Hi All,
Here is the problem I am facing when using MouseMove event:
When user moves the mouse over a date say on 4th September, I want to access this date in the MouseMove event so that I can display a text on the tooltop saying "Today is 4th".
I tried checking ActiveDate, SelectedDate but nothing works out. MouseEventArgs is not giving either. I can't use IsSelected with a trigger as the date is not selected.
I tried to keep a trigger for IsMouseMove but did not work.
Please help me on this.
Thanks
Nag
Hello Nag,
Thank you for your post.
I have been looking into your issue and I created a sample application(ToolTipXamCalendar.zip) based on your scenario to show you how you can implement the functionality that you want to achieve. In the sample I created Style for CalendarDay to show the ToolTip for the element that is selected from the cursor of the mouse. To be able to format the text in the ToolTip I set the ContentStringFormat property of ToolTip.
Please let me know if you need any further assistance on this matter.
Hi Zhivko,
Thanks for the quick reply and code.
It is great to know this. But I am looking for the tooltip to be populated from code behind rather than from GUI. I checked below two links
http://www.infragistics.com/community/forums/p/86762/432941.aspx
http://www.infragistics.com/community/forums/t/61168.aspx
But I did not understand how the convert functions will be called.
Please can you tell me how can I call my own user defined function so that I can update tooltip with my data.
Thanks,
I have been looking into your question and I modified the sample application to show how you can implement the functionality that you want to achieve. In the sample I created a ToolTip that is populated from code behind as I handled the Loaded event of XamCalendar and in the event handler I create two styles for CalendarDay and for ToolTip.
Thanks a lot for the reply and code.
But I was looking for a convert() type function. As I said in my previous post, I want to assign the content string from my own data.
The loaded event fires once and the data is bind with the date.
I moved your code to MouseMove() event handles and I can get the same the tool tip (It throws some exception saying ToolTip and CalendarDay already added. So I removed them using Resources.Remove(typeof(ToolTip). But the problem I am facing is I am not getting how to get the date it is hovered / moved on.
My intention is, I have list of items mapped to each day in a dictionary. Like on 10th Oct - You have a meeting, 11th Oct - Requirements discussion etc.
So when user hovers / moves mouse on on 10th, I want to display "You have a meeting" and so and so time...
Please let me know if this is possible.
Reg,
I was looking into your issue and I modified the sample application to show you how you can implement the functionality that you have described. I created a style for the CalendarDay and used a MultiBinding for the ToolTip property. I bound the ToolTip to the StartDay of the CalendarDay and also to the ViewModel, which contains the Dictionary with the appointments. In the converter, I am generating the tooltip, based on the date on which the mouse is located.