Freezable.GetCurrentValueAsFrozen Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a frozen copy of the Freezable using current property values. Because the copy is frozen, any frozen sub-objects are copied by reference.
public:
System::Windows::Freezable ^ GetCurrentValueAsFrozen();
public System.Windows.Freezable GetCurrentValueAsFrozen ();
member this.GetCurrentValueAsFrozen : unit -> System.Windows.Freezable
Public Function GetCurrentValueAsFrozen () As Freezable
Returns
A frozen copy of the Freezable. The copy's IsFrozen property is set to true
.
Remarks
Using this method is similar to creating a copy using the CloneCurrentValue and then freezing it with the Freeze method.
The GetAsFrozen and GetCurrentValueAsFrozen methods can improve copying performance because they do not clone Freezable sub-objects that are already frozen; they only copy them by reference.
The following table summarizes the differences between the GetAsFrozen and GetCurrentValueAsFrozen methods.
Action | GetAsFrozen method behavior | GetCurrentValueAsFrozen method behavior |
---|---|---|
Copying a dependency property that has an expression | The method throws an InvalidOperationException because it cannot Freeze the property. | The current value of the expression is copied, but not the expression itself. |
Copying an animated dependency property | The property's base (non-animated) value is copied. Animations are not copied. | The property's current animated value is copied. Animations are not copied. |
Note that unset properties are not copied, nor are read-only properties.
To create a copy of the Freezable that is not frozen, use the CloneCurrentValue method.
Notes to Inheritors
This method uses the virtual GetCurrentValueAsFrozenCore(Freezable) method to produce the clone.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기