Browse Source
Merge pull request #5093 from AvaloniaUI/fixes/4655-dynamicresource-invalidcast
Prevent exceptions when removing styles.
pull/5107/head
Dan Walmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
2 deletions
-
src/Avalonia.Styling/Controls/ResourceNodeExtensions.cs
|
|
|
@ -147,13 +147,16 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
if (_target.Owner is object) |
|
|
|
{ |
|
|
|
observer.OnNext(Convert(_target.Owner?.FindResource(_key))); |
|
|
|
observer.OnNext(Convert(_target.Owner.FindResource(_key))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void PublishNext() |
|
|
|
{ |
|
|
|
PublishNext(Convert(_target.Owner?.FindResource(_key))); |
|
|
|
if (_target.Owner is object) |
|
|
|
{ |
|
|
|
PublishNext(Convert(_target.Owner.FindResource(_key))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void OwnerChanged(object sender, EventArgs e) |
|
|
|
|