TokenHovering -> TokenPointerOver
This commit is contained in:
Родитель
bc95b9a9e3
Коммит
0428550457
|
@ -109,7 +109,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
{
|
||||
this._tsb.SuggestionChosen -= this.SuggestingBox_OnSuggestionChosen;
|
||||
this._tsb.SuggestionsRequested -= this.SuggestingBox_OnSuggestionsRequested;
|
||||
this._tsb.TokenHovering -= this.SuggestingBox_OnTokenHovering;
|
||||
this._tsb.TokenPointerOver -= this.SuggestingBox_OnTokenPointerOver;
|
||||
}
|
||||
|
||||
if (control.FindChild("SuggestingBox") is RichSuggestBox rsb)
|
||||
|
@ -124,7 +124,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
this._tsb = tsb;
|
||||
this._tsb.SuggestionChosen += this.SuggestingBox_OnSuggestionChosen;
|
||||
this._tsb.SuggestionsRequested += this.SuggestingBox_OnSuggestionsRequested;
|
||||
this._tsb.TokenHovering += this.SuggestingBox_OnTokenHovering;
|
||||
this._tsb.TokenPointerOver += this.SuggestingBox_OnTokenPointerOver;
|
||||
}
|
||||
|
||||
if (control.FindChild("TokenListView1") is ListView tls1)
|
||||
|
@ -138,7 +138,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
}
|
||||
}
|
||||
|
||||
private void SuggestingBox_OnTokenHovering(RichSuggestBox sender, RichSuggestTokenHoveringEventArgs args)
|
||||
private void SuggestingBox_OnTokenPointerOver(RichSuggestBox sender, RichSuggestTokenPointerOverEventArgs args)
|
||||
{
|
||||
var flyout = (Flyout)FlyoutBase.GetAttachedFlyout(sender);
|
||||
var pointerPosition = args.CurrentPoint.Position;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
/// <summary>
|
||||
/// Event raised when a pointer is hovering over a token.
|
||||
/// </summary>
|
||||
public event TypedEventHandler<RichSuggestBox, RichSuggestTokenHoveringEventArgs> TokenHovering;
|
||||
public event TypedEventHandler<RichSuggestBox, RichSuggestTokenPointerOverEventArgs> TokenPointerOver;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when text is changed, either by user or by internal formatting.
|
||||
|
|
|
@ -258,9 +258,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
private void RichEditBox_OnPointerMoved(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
var pointer = e.GetCurrentPoint(this);
|
||||
if (TokenHovering != null)
|
||||
if (this.TokenPointerOver != null)
|
||||
{
|
||||
this.InvokeTokenHovering(pointer);
|
||||
this.InvokeTokenPointerOver(pointer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,7 +473,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
});
|
||||
}
|
||||
|
||||
private void InvokeTokenHovering(PointerPoint pointer)
|
||||
private void InvokeTokenPointerOver(PointerPoint pointer)
|
||||
{
|
||||
var pointerPosition = TransformToVisual(_richEditBox).TransformPoint(pointer.Position);
|
||||
var padding = _richEditBox.Padding;
|
||||
|
@ -488,7 +488,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
if (hitTestRect.Contains(pointerPosition) && linkRange.Expand(TextRangeUnit.Link) > 0 &&
|
||||
TryGetTokenFromRange(linkRange, out var token))
|
||||
{
|
||||
this.TokenHovering.Invoke(this, new RichSuggestTokenHoveringEventArgs
|
||||
this.TokenPointerOver.Invoke(this, new RichSuggestTokenPointerOverEventArgs
|
||||
{
|
||||
Token = token,
|
||||
Range = linkRange,
|
||||
|
|
|
@ -9,9 +9,9 @@ using Windows.UI.Text;
|
|||
namespace Microsoft.Toolkit.Uwp.UI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="RichSuggestBox.TokenHovering"/> event.
|
||||
/// Provides data for <see cref="RichSuggestBox.TokenPointerOver"/> event.
|
||||
/// </summary>
|
||||
public class RichSuggestTokenHoveringEventArgs : EventArgs
|
||||
public class RichSuggestTokenPointerOverEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the selected token.
|
Загрузка…
Ссылка в новой задаче