Silverlight tooltip - change ShowDuration lightweight - silverlight

Hi I am trying to change ShowDuration of tooltip and this is not supported in silverlight.
I dont want a heavyweight tooltip solution that is available on codeplex. My current idea is to edit something in tooltip template.
I looked with reflector and wasn't able to find default duration in tooltip so I think its being set in xaml. ( probably in storyboard for open tooltip event)
default tooltip style is given here http://msdn.microsoft.com/en-us/library/dd334410(VS.95).aspx.
there are two storyboard keys present in it but where can I find their implementation and override?
If someone posted template with for example infinite duration tooltip I would be grateful.
This isn't a duplicate of this ShowDuration attribute cannot resolve in tooltip at silverlight 4 cause I am mainly looking for those 2 storyboards to edit them myself, not to mention other question isn't really answered

There is nothing you can do about it unless you create your own ToolTipService (note its this service class not the ToolTip itself that is the problem). The 5 second limit is baked into the code, it has nothing to do with the Storyboards.
If you want see this for yourself in Reflector open the ToolTipService class and look at the OpenAutomaticTooltip method.

Related

How to get WPF default Styles and ControlTemplates for DataGrid and sub controls?

I need to make several changes to the default Styles and ControlTemplates of all major UserControls of my application. I found this very easy to do for allmost all UserControls (RightClick control in VS2015 designer => Edit template => Edit a copy...) and maybe a little bit more complicated for the more complex ones like the Calendar, but I totally fail for DataGrid and its now sub controls.
While it is of course easy to get the style and template for the DataGrid itself I still need the styles for DataGridRow, DataGridRowHeader, DataGridColumnHeader, DataGridCell, ... I do not even know all possible sub elements.
I searched the internet for about half a day now and could not find any solution to my issue:
If I check the MSDN for default styles of the DataGrid it gives me a bad example that contains weird stuff like FrozenGridDataGrid and other stuff that is not contained in the referenced Namespaces and assemblies. I'm not sure if this example is targeted towards Silverlight only...
Tools like 'Show Me The Templates!' do not list the DataGrid...
The BAML Viewer addin for .Net Reflector does only show me my custom styles but not the default ones. Targeting for example the PresentationFramework.Aero.dll does not work.
I even found an example by Jamie Rodriguez on the MSDN on how to style the DataGrid which gets very close to what I need - but then again I do not know how close his code is to the defaults, if something is missing and also his result looks like a color palette...
Can anyone please tell me what styles and templates I need to cover the whole DataGrid and where I can get their defaults?
Thanks
Use Blend.
You will get all templates.

Tooltip adorner

I am using a third party charting library (Infragistics xamChart). I am not satisfied with how tooltips are displayed on a line charts datapoints so I was thinking of using an adorner to make a better looking/interactive tooltip.
What I want to do is have the adorner popup whenever one of the datapoints is hovered over. Does anyone have any pointers on how I can do this? Most of the adorner samples I found are pretty simple ones that just alter the entire control they are adorning.
My main questions are:
Is it possible for an adorner to
appear only when certain elements are
hovered over (and have it appear at
the current cursor position)?
Does anyone have a simple sample they
can share?
Are adorners the right way to go
here? I think the only other option
was to use the popup control but I
though adorners were a nicer
solution.
Thank you.
Perhaps Attached Behaviours could help you? From this article:
The idea is that you set an attached
property on an element so that you can
gain access to the element from the
class that exposes the attached
property. Once that class has access
to the element, it can hook events on
it.
That way you could attach a listener to the MouseEnter event and display your custom ToolTip from there.

VisualstateManager in Style

I am new to both Silverlight and Blend 4.
I am trying to make a Image Gallery, where u click on the image and it shows details of the same.
I used VisualStateManager to get a mouseOver and mouseOut effect to the thumbnails. and here is wat i want. I want to add the VisualState's to all my thumbnails through Style. (I had seen this in some forum, but i cudnt figure it out how he did it.)
Here is wat i want:
I have set of thumbnails to, which need to scale up on MouseOver and come back to normal on MouseOUT. I created a VisualStateManager States.
But i want to use the state as a
common state for all the thumbnails
and apply it to the thumbnails through
Style.
Is this possible? If so how?
If not? then is how can i achieve it.
Would be really thankful to any one who can help me :) just that this is a bit urgent. :(
MSDN documentation says that you should be able to add the VisualStageManager XAML tag to any control which inherits from UIElement and accepts child controls.
It seems to me then that the best way to do this is to create a UserControl for your thumbnail and set the VisualStateManager there. You can then reuse that UserControl.
More reading material:
MSDN UserControl documentation
Adding behaviour to stock controls

Winform TabControl style

I'm once again turning to you since I can't find an answer anywhere else. I have a TabControl, but I want to get rid of the ugly orange bar on top of the selected tabs. I would also like to make the tab text BOLD when selected and NORMAL when not.
Is there any easy way to achieve that goal ? I don't want to use the Appearance Buttons or Flat Buttons.
Thanks for your help !
This appearance is controlled by the Visual Styles theme selected in your operating system. In general, users do not appreciate any program that ignores their theme settings, especially when they paid money for a custom one. But you can get what you want, you'll have to set the DrawMode property to OwnerDrawFixed and implement a handler for the DrawItem event. There's a good example to get you started in the MSDN Library article for this event. Just change the font assignment in that sample code.

How to make the selected TabItem look attached to the rest of the document

I have a WPF app with a few Tabs. I'm now messing around with styling and have for example changed the ControlTemplate so I now have to define everything about the TabItem.
Now the TabItem that is selected seems detached from the document below because of some thin line around that content (there is no border). I'm not sure what technique to use to make it look attached again.
My guess would be that the Header-template is responsible for the problem. You can style that too tho - see this example for details: http://www.switchonthecode.com/tutorials/the-wpf-tab-control-inside-and-out

Resources