Browse Source

Added ToolTip to ControlCatalog.

pull/486/head
Steven Kirk 10 years ago
parent
commit
92452afc6f
  1. 8
      samples/ControlCatalog/ControlCatalog.csproj
  2. 1
      samples/ControlCatalog/MainWindow.xaml
  3. 22
      samples/ControlCatalog/Pages/ToolTipPage.xaml
  4. 18
      samples/ControlCatalog/Pages/ToolTipPage.xaml.cs
  5. 2
      src/Perspex.Controls/ToolTip.cs

8
samples/ControlCatalog/ControlCatalog.csproj

@ -60,6 +60,9 @@
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\ToolTipPage.xaml.cs">
<DependentUpon>ToolTipPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\TextBoxPage.xaml.cs">
<DependentUpon>TextBoxPage.xaml</DependentUpon>
</Compile>
@ -220,6 +223,11 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\ToolTipPage.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

1
samples/ControlCatalog/MainWindow.xaml

@ -14,5 +14,6 @@
<TabItem Header="LayoutTransformControl"><pages:LayoutTransformControlPage/></TabItem>
<TabItem Header="Slider"><pages:SliderPage/></TabItem>
<TabItem Header="TextBox"><pages:TextBoxPage/></TabItem>
<TabItem Header="ToolTip"><pages:ToolTipPage/></TabItem>
</TabControl>
</Window>

22
samples/ControlCatalog/Pages/ToolTipPage.xaml

@ -0,0 +1,22 @@
<UserControl xmlns="https://github.com/perspex">
<StackPanel Orientation="Vertical" Gap="4">
<TextBlock Classes="h1">ToolTip</TextBlock>
<TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock>
<StackPanel Orientation="Horizontal"
Margin="0,16,0,0"
HorizontalAlignment="Center"
Gap="16">
<Border Background="{StyleResource ThemeAccentBrush}"
Padding="48,48,48,48">
<ToolTip.Tip>
<StackPanel>
<TextBlock Classes="h1">ToolTip</TextBlock>
<TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock>
</StackPanel>
</ToolTip.Tip>
<TextBlock>Hover Here</TextBlock>
</Border>
</StackPanel>
</StackPanel>
</UserControl>

18
samples/ControlCatalog/Pages/ToolTipPage.xaml.cs

@ -0,0 +1,18 @@
using Perspex.Controls;
using Perspex.Markup.Xaml;
namespace ControlCatalog.Pages
{
public class ToolTipPage : UserControl
{
public ToolTipPage()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
PerspexXamlLoader.Load(this);
}
}
}

2
src/Perspex.Controls/ToolTip.cs

@ -11,7 +11,7 @@ using Perspex.Threading;
namespace Perspex.Controls
{
/// <summary>
/// A tooltip control.
/// A control which pops up a hint when a control is hovered.
/// </summary>
/// <remarks>
/// You will probably not want to create a <see cref="ToolTip"/> control directly: if added to

Loading…
Cancel
Save