路径上的光标未出现在SilverLight中

时间:2010-05-06 03:15:04

标签: silverlight silverlight-3.0

我正在尝试使用Alpha绘制一个带有玻璃效果的圆圈。我通过使用下面的XAML成功地创建了它。对于省略号,光标变为Hand,但它不会影响Path。基本上,我想在鼠标出现在圆圈上的任何地方显示“手”光标。我希望这不是一个已知的问题,我错过了一些小问题。任何帮助都非常感谢。


<Ellipse Cursor="Hand" 
    Width="200" 
    Height="200" 
    Fill="#C42222" Canvas.Left="0" Canvas.Top="0" />

<Ellipse Cursor="Hand" Width="200" Height="200" Canvas.Left="0" Canvas.Top="0">
    <Ellipse.Fill>
        <RadialGradientBrush GradientOrigin="0.3,0.7">
            <GradientStop 
                Offset="0" 
                Color="#00000000" />
            <GradientStop 
                Offset="1" 
                Color="#66000000" />
        </RadialGradientBrush>
    </Ellipse.Fill>
</Ellipse>

<Path Cursor="Hand" Stretch="Fill" Height="114.598" Width="198.696" Data="M98.388435,-1.3301961 C98.388435,-1.3301961 117.1151,-3.094949 141.69321,8.1370029 C156.42262,14.868201 167.67375,23.694145 175.66234,33.657074 C183.67349,43.648144 181.90166,37.8708 191.90166,58.8708 C201.90166,79.870796 199.16658,89.212738 199.13568,92.90377 C198.77556,135.92146 175.45959,97.59124 156.75465,81.024025 C140.98892,67.060104 117.41241,64.357407 114.41241,64.357407 C111.4124,64.357407 83.061241,60.114159 63.061195,71.114143 C43.061146,82.114136 39.637829,86.429352 22.999804,100.99996 C6.5005584,115.44904 2.9997537,112.99996 2.9997537,112.99996 C2.9997537,112.99996 -1.1832786,97.194221 1.9997513,81.999893 C7.2054667,57.150185 13.999762,47.999939 17.999771,42.999943 C21.999781,37.99995 29.935833,23.400871 54.053131,10.21261 C78.91642,-3.3835876 98.388435,-1.3301961 98.388435,-1.3301961 z">
 <Path.Fill>
  <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
   <GradientStop Color="#55FFFFFF" Offset="0"/>
   <GradientStop Color="#11FFFFFF" Offset="0.5"/>
   <GradientStop Color="#00FFFFFF" Offset="1"/>
  </LinearGradientBrush>
 </Path.Fill>
</Path>

1 个答案:

答案 0 :(得分:0)

  

我想在鼠标出现在圆圈上的任何地方显示“手”光标。

当鼠标悬停在路径上时,手形光标出现在我对路径的测试中。然而,也许线索可能在您的描述中。 Path并未描述更像新月的圆圈。将Stroke="Black" StrokeThickness="1"添加到路径中,以便您可以查看其轮廓并测试光标确实有效。

另一种可能性在于你的实际Xaml中还有其他东西具有高z-index或稍后出现在覆盖Path的Xaml文档顺序中。