I am building an app using Xamarin forms PCL. My app will work on android, ios, windows 10 and windows 8.1.
I need to implement a tooltip control on tap event for windows os only. I tried tooltip like this-
if(Device.OS == TargetPlatform.Windows)
{
var tapGestureRecognizer1 = new TapGestureRecognizer();
tapGestureRecognizer1.Tapped += TapGestureRecognizer1_Tapped1;
icon1.GestureRecognizers.Add(tapGestureRecognizer1);
}
private void TapGestureRecognizer1_Tapped1(object sender, EventArgs e)
{
Constant.UserActiveTime = DateTime.Now;
Windows.UI.Xaml.Controls.ToolTip toolTip1 = new Windows.UI.Xaml.Controls.ToolTip();
toolTip1.Content = "Hi";
toolTip1.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
Is there any working sample for tooltip control or any nuget package?
Parent
property. If it isnull
, don't be surprised your tooltip doesn't show. - Sefe