2012-09-26 2 views
0

사용자 지정 서식 파일을 사용하여 다음 사용자 지정 도구 설명을 만들었습니다. Silverlight 프로그래밍 방식으로 사용자 지정 도구 설명 설정

behvior 내에서 내가 내 사용자 지정 도구 팁 컨트롤의 인스턴스에 assosciated 개체의 도구 설명을 설정해야합니다 무엇 내가해야 할 것은,이다

<ToolTip x:Class="FireFly.Controls.CustomToolTip" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
d:DesignHeight="300" d:DesignWidth="400"> 
<ToolTip.Style> 
    <Style TargetType="ToolTip"> 
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="ToolTip"> 
        <Border> 
         <Border.Background> 
          <RadialGradientBrush> 
           <GradientStop Color="WhiteSmoke"/> 
           <GradientStop Color="#FFE0E0E0" Offset="1"/> 
          </RadialGradientBrush> 
         </Border.Background> 
         <ContentPresenter Content="{TemplateBinding Content}" 
           ContentTemplate="{TemplateBinding ContentTemplate}" 
           Margin="{TemplateBinding Padding}" 
           VerticalAlignment="Center"/> 
        </Border> 
       </ControlTemplate> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</ToolTip.Style>  

.

toolTip = new CustomToolTip() {Content = new TextBlock() {Text = text, FontSize = 12}}; 

같은

뭔가 그러나이 작동하지 않습니다.

누군가 나를 올바른 방향으로 향하게 할 수 있습니까?

감사

스티브

+0

'theAssociatedObject.ToolTip = new CustomToolTip()'이라고 쓰면 충분합니다. – McGarnagle

답변

0

나는 또 다른 제 3 자 툴팁 제공자를 사용했습니다. .net 프레임 워크에 내장 된 것만으로는 충분하지 않습니다.

관련 문제