Primary WPF APIs:
ToolTipToolTipServicePrimary Avalonia APIs:
ToolTip attached properties (ToolTip.Tip, delay/placement properties)HyperlinkButton (NavigateUri)TopLevel.Launcher for external help links/files| WPF | Avalonia |
|---|---|
ToolTipService.ToolTip |
ToolTip.Tip |
| tooltip timing/placement service settings | equivalent attached tooltip settings |
| help links launched from commands | TopLevel.Launcher.LaunchUriAsync(...) |
WPF XAML:
<TextBox ToolTipService.ToolTip="Enter legal name" />
<Button Content="Help" />
Avalonia XAML:
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:MyApp.ViewModels"
x:DataType="vm:HelpViewModel">
<StackPanel Spacing="8">
<TextBox ToolTip.Tip="Enter legal name"
Text="{CompiledBinding Name, Mode=TwoWay}" />
<Button Content="Save"
ToolTip.Tip="Saves current record"
Command="{CompiledBinding SaveCommand}" />
<HyperlinkButton Content="Open Help"
NavigateUri="https://docs.example.com/app/help" />
</StackPanel>
</UserControl>
using System;
using System.Threading.Tasks;
using Avalonia.Controls;
public static class HelpActions
{
public static async Task OpenHelpAsync(Control anchor)
{
ToolTip.SetTip(anchor, "Context help");
var top = TopLevel.GetTopLevel(anchor);
if (top is not null)
await top.Launcher.LaunchUriAsync(new Uri("https://docs.example.com/app/help"));
}
}