FrameworkContentElement.OnStyleChanged(Style, Style) 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.
Invoked when the style that is in use on this element changes.
protected public:
virtual void OnStyleChanged(System::Windows::Style ^ oldStyle, System::Windows::Style ^ newStyle);
protected internal virtual void OnStyleChanged (System.Windows.Style oldStyle, System.Windows.Style newStyle);
abstract member OnStyleChanged : System.Windows.Style * System.Windows.Style -> unit
override this.OnStyleChanged : System.Windows.Style * System.Windows.Style -> unit
Protected Friend Overridable Sub OnStyleChanged (oldStyle As Style, newStyle As Style)
Parameters
- oldStyle
- Style
The old style.
- newStyle
- Style
The new style.
Remarks
This method has a default implementation that sets an internal flag noting the style changed condition.
Notes to Inheritors
Always call the base implementation, otherwise styles cannot be applied. Scenarios for overriding this method might include if your derived class has a specialized style selector, or caches style values. Theme changes will potentially invoke this method.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈