Permalink
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (126 sloc) 5.05 KB
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.Pane1"
Loaded="OnLoad"
>
<Window.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="Brown"/>
</Style>
</Window.Resources>
<Grid ShowGridLines ="false" Background ="White" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition Width="420" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="75"/>
<RowDefinition Height="75"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Margin="10, 10, 3, 3" Grid.Row="0" Grid.Column="0"
FontSize="12">ToolTips created by using XAML</TextBlock>
<TextBlock Margin="10, 10, 3, 3" Grid.Row="0" Grid.Column="1"
FontSize="12">ToolTips created by using code</TextBlock>
<StackPanel Margin="10, 0, 3, 3" Grid.Column="0" Grid.Row="1">
<!--<SnippetToolTip>-->
<Ellipse Height="25" Width="50"
Fill="Gray"
HorizontalAlignment="Left"
ToolTipService.InitialShowDelay="1000"
ToolTipService.ShowDuration="7000"
ToolTipService.BetweenShowDelay="2000">
<Ellipse.ToolTip>
<ToolTip Placement="Right"
PlacementRectangle="50,0,0,0"
HorizontalOffset="10"
VerticalOffset="20"
HasDropShadow="false"
Opened="whenToolTipOpens"
Closed="whenToolTipCloses"
>
<BulletDecorator>
<BulletDecorator.Bullet>
<Ellipse Height="10" Width="20" Fill="Blue"/>
</BulletDecorator.Bullet>
<TextBlock>Uses the ToolTip Class</TextBlock>
</BulletDecorator>
</ToolTip>
</Ellipse.ToolTip>
</Ellipse>
<!--</SnippetToolTip>-->
</StackPanel>
<StackPanel Margin="10, 3, 3, 3" Grid.Column="0" Grid.Row="2">
<!--<SnippetNoToolTip>-->
<Ellipse Height="25" Width="50"
Fill="Gray"
HorizontalAlignment="Left"
ToolTipService.InitialShowDelay="1000"
ToolTipService.ShowDuration="7000"
ToolTipService.BetweenShowDelay="2000"
ToolTipService.Placement="Right"
ToolTipService.PlacementRectangle="50,0,0,0"
ToolTipService.HorizontalOffset="10"
ToolTipService.VerticalOffset="20"
ToolTipService.HasDropShadow="false"
ToolTipService.ShowOnDisabled="true"
ToolTipService.IsEnabled="true"
ToolTipOpening="whenToolTipOpens"
ToolTipClosing="whenToolTipCloses"
>
<Ellipse.ToolTip>
<BulletDecorator>
<BulletDecorator.Bullet>
<Ellipse Height="10" Width="20" Fill="Blue"/>
</BulletDecorator.Bullet>
<TextBlock>Uses the ToolTipService class</TextBlock>
</BulletDecorator>
</Ellipse.ToolTip>
</Ellipse>
<!--</SnippetNoToolTip>-->
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Margin="10,0,0,0">
<TextBlock>
The above tooltips have the following settings
</TextBlock>
<TextBlock Margin="20,10,0,0" Foreground="Blue" FontSize="11"
Text="-InitialShowDelay=1000ms (1 second)"/>
<TextBlock Margin="20,0,0,0" Foreground="Blue" FontSize="11"
Text="-BetweenShowDelay=2000ms (2 seconds)"/>
<TextBlock Margin="20,0,0,0" Foreground="Blue" FontSize="11"
Text="-ShowDuration=7000ms (7 seconds)"/>
<TextBlock HorizontalAlignment="Left"
Width="250" TextWrapping="Wrap"
Margin="0,10,0,0">
The BetweenShowDelay property value of two seconds allows
the initial delay(InitialShowDelay) to be bypassed if you
move the mouse pointer between the tooltips within the two
second time window.
</TextBlock>
</StackPanel>
<StackPanel Name="stackPanel_1_1"
Margin="10, 0, 3, 3" Grid.Column="1" Grid.Row="1"/>
<StackPanel Name="stackPanel_1_2"
Margin="10, 0, 3, 3" Grid.Column="1" Grid.Row="2"/>
<StackPanel
Margin="10, 0, 3, 3" Grid.Column="1" Grid.Row="3">
<Button Click="showProperties" Background="Blue" Foreground="White">
click to view tooltip property values for above tooltip
</Button>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="115" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="500"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row ="0" Grid.Column="0" Name="ttProperties"></TextBlock>
<TextBlock Grid.Row ="0" Grid.Column="1" Name="ttPropertyValues"></TextBlock>
</Grid>
</StackPanel>
</Grid>
</Window>