Primary WinForms APIs:
ToolTipHelpProviderPrimary Avalonia APIs:
ToolTip attached properties (ToolTip.Tip, placement/delay options)HyperlinkButton and launcher integration| WinForms | Avalonia |
|---|---|
toolTip.SetToolTip(control, text) |
ToolTip.Tip="..." or ToolTip.SetTip(control, ...) |
HelpProvider.SetHelpString(...) |
help text via tooltip/flyout + help command |
| shell help launch | TopLevel.Launcher.LaunchUriAsync(...) |
WinForms C#:
var tips = new ToolTip();
tips.SetToolTip(nameTextBox, "Enter full legal name");
var help = new HelpProvider();
help.SetHelpString(saveButton, "Save all changes to the current customer.");
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:CustomerEditorViewModel">
<StackPanel Spacing="8">
<TextBox Watermark="Customer name"
ToolTip.Tip="Enter full legal name"
Text="{CompiledBinding CustomerName, Mode=TwoWay}" />
<Button Content="Save"
ToolTip.Tip="Save all changes to the current customer"
Command="{CompiledBinding SaveCommand}" />
<HyperlinkButton Content="Open Help"
NavigateUri="https://docs.example.com/customer-editor" />
</StackPanel>
</UserControl>
using System;
using System.Threading.Tasks;
using Avalonia.Controls;
public static async Task OpenHelpAsync(Control anchor)
{
ToolTip.SetTip(anchor, "Context-sensitive help");
var top = TopLevel.GetTopLevel(anchor);
if (top is not null)
await top.Launcher.LaunchUriAsync(new Uri("https://docs.example.com/customer-editor"));
}
TopLevel availability and launcher capability on platform/runtime.