protected override void OnAttached() { var control = Control ?? Container; if (control is DependencyObject) { ToolTip toolTip = new ToolTip(); toolTip.Content = TooltipEff.GetText(Element); switch (TooltipEff.GetPosition(Element)) { case TooltipPosition.Bottom: toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Bottom; break; case TooltipPosition.Top: toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Top; break; case TooltipPosition.Left: toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Left; break; case TooltipPosition.Right: toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Right; break; default: return; } ToolTipService.SetToolTip(control, toolTip); } }
protected override void OnAttached() { if (View == null) { return; } View.TooltipText = TooltipEff.GetText(Element); }