Showing custom tooltip?/Popup when hovering over an object in Silverlight

前端 未结 2 1910
伪装坚强ぢ
伪装坚强ぢ 2021-01-01 03:56

How can I go about getting similar popup/hover/tooltip (see image below) when I hover or click on an object in my Silverlight app?

Update:

2条回答
  •  耶瑟儿~
    2021-01-01 04:17

    Expression Blend 4 has this kind of callout shape and you can apply a to it. To put text inside, just wrap a textbox and the callout in a canvas. From this site:

    Expression Blend 4 now includes presets for the easy creation of arcs, arrows, callouts, and polygons. Shapes can be easily switched between sketch-style and regular-style rendering. This feature can be found in the Assets panel under the new Shapes category.

    I've used the callouts - very handy and very similar in usage to AutoShapes in Office. To do a pop-up, you'll just need a simple animation.

    If you don't have Expressions, you could hand-code the XAML for creating the callout. Here's an example of one that I made:

    
        
            
        
        
            
              
                
                  
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                  
                
              
            
        
    
    

    The callout's tail isn't exactly like the one in the sample and the dropshadow is also different, but different values can be changed to try to make it look as close as possible to the sample.

提交回复
热议问题