-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c443cdd
commit f4fd1b5
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using Uno.UI.DataBinding; | ||
using Uno.UI.Extensions; | ||
using Uno.UI.Xaml.Core; | ||
|
||
namespace Windows.UI.Xaml.Documents; | ||
|
||
public partial class TextElement | ||
{ | ||
private ManagedWeakReference? _visualTreeCacheWeakReference; | ||
|
||
/// <summary> | ||
/// Gets or sets the XamlRoot in which this element is being viewed. | ||
/// </summary> | ||
public XamlRoot? XamlRoot | ||
{ | ||
get => XamlRoot.GetForElement(this); | ||
set => XamlRoot.SetForElement(this, XamlRoot, value); | ||
} | ||
|
||
internal VisualTree? VisualTreeCache | ||
{ | ||
get => _visualTreeCacheWeakReference?.IsDisposed == false ? | ||
_visualTreeCacheWeakReference.Target as VisualTree : null; | ||
set => _visualTreeCacheWeakReference = WeakReferencePool.RentWeakReference(this, value); | ||
} | ||
} |