diff --git a/build/SourceLink.props b/build/SourceLink.props index 1e007e01eb..0f77c2a613 100644 --- a/build/SourceLink.props +++ b/build/SourceLink.props @@ -3,7 +3,7 @@ true false true - embedded + full $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/src/Avalonia.Animation/Animators/Animator`1.cs b/src/Avalonia.Animation/Animators/Animator`1.cs index d784227620..23afa76bf6 100644 --- a/src/Avalonia.Animation/Animators/Animator`1.cs +++ b/src/Avalonia.Animation/Animators/Animator`1.cs @@ -79,15 +79,15 @@ namespace Avalonia.Animation.Animators T oldValue, newValue; - if (firstKeyframe.isNeutral) - oldValue = neutralValue; + if (!firstKeyframe.isNeutral && firstKeyframe.Value is T firstKeyframeValue) + oldValue = firstKeyframeValue; else - oldValue = (T)firstKeyframe.Value; + oldValue = neutralValue; - if (lastKeyframe.isNeutral) - newValue = neutralValue; + if (!lastKeyframe.isNeutral && lastKeyframe.Value is T lastKeyframeValue) + newValue = lastKeyframeValue; else - newValue = (T)lastKeyframe.Value; + newValue = neutralValue; if (lastKeyframe.KeySpline != null) progress = lastKeyframe.KeySpline.GetSplineProgress(progress); diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs index 7b32e21fbd..9905aa4afc 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs @@ -17,16 +17,16 @@ namespace Avalonia.Diagnostics.ViewModels internal class ControlDetailsViewModel : ViewModelBase, IDisposable { private readonly IVisual _control; - private IDictionary> _propertyIndex; + private IDictionary>? _propertyIndex; private PropertyViewModel? _selectedProperty; - private DataGridCollectionView _propertiesView; + private DataGridCollectionView? _propertiesView; private bool _snapshotStyles; private bool _showInactiveStyles; private string? _styleStatus; - private object _selectedEntity; + private object? _selectedEntity; private readonly Stack<(string Name,object Entry)> _selectedEntitiesStack = new(); - private string _selectedEntityName; - private string _selectedEntityType; + private string? _selectedEntityName; + private string? _selectedEntityType; public ControlDetailsViewModel(TreePageViewModel treePage, IVisual control) { @@ -117,7 +117,7 @@ namespace Avalonia.Diagnostics.ViewModels public TreePageViewModel TreePage { get; } - public DataGridCollectionView PropertiesView + public DataGridCollectionView? PropertiesView { get => _propertiesView; private set => RaiseAndSetIfChanged(ref _propertiesView, value); @@ -127,7 +127,7 @@ namespace Avalonia.Diagnostics.ViewModels public ObservableCollection PseudoClasses { get; } - public object SelectedEntity + public object? SelectedEntity { get => _selectedEntity; set @@ -137,7 +137,7 @@ namespace Avalonia.Diagnostics.ViewModels } } - public string SelectedEntityName + public string? SelectedEntityName { get => _selectedEntityName; set @@ -147,7 +147,7 @@ namespace Avalonia.Diagnostics.ViewModels } } - public string SelectedEntityType + public string? SelectedEntityType { get => _selectedEntityType; set @@ -270,7 +270,7 @@ namespace Avalonia.Diagnostics.ViewModels private void ControlPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) { - if (_propertyIndex.TryGetValue(e.Property, out var properties)) + if (_propertyIndex is { } && _propertyIndex.TryGetValue(e.Property, out var properties)) { foreach (var property in properties) { @@ -284,6 +284,7 @@ namespace Avalonia.Diagnostics.ViewModels private void ControlPropertyChanged(object? sender, PropertyChangedEventArgs e) { if (e.PropertyName != null + && _propertyIndex is { } && _propertyIndex.TryGetValue(e.PropertyName, out var properties)) { foreach (var property in properties) @@ -402,7 +403,7 @@ namespace Avalonia.Diagnostics.ViewModels var selectedProperty = SelectedProperty; var selectedEntity = SelectedEntity; var selectedEntityName = SelectedEntityName; - if (selectedProperty == null) + if (selectedEntity == null || selectedProperty == null) return; object? property; @@ -419,7 +420,7 @@ namespace Avalonia.Diagnostics.ViewModels ?.GetValue(selectedEntity); } if (property == null) return; - _selectedEntitiesStack.Push((Name:selectedEntityName,Entry:selectedEntity)); + _selectedEntitiesStack.Push((Name:selectedEntityName!,Entry:selectedEntity)); NavigateToProperty(property, selectedProperty.Name); } diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs index 4b18cf414a..27b28f35fc 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs @@ -15,7 +15,7 @@ namespace Avalonia.Diagnostics.ViewModels Nodes = nodes; PropertiesFilter = new FilterViewModel(); - PropertiesFilter.RefreshFilter += (s, e) => Details?.PropertiesView.Refresh(); + PropertiesFilter.RefreshFilter += (s, e) => Details?.PropertiesView?.Refresh(); SettersFilter = new FilterViewModel(); SettersFilter.RefreshFilter += (s, e) => Details?.UpdateStyleFilters(); diff --git a/src/Avalonia.Themes.Default/Expander.xaml b/src/Avalonia.Themes.Default/Expander.xaml index 7df65677b6..e72ddea163 100644 --- a/src/Avalonia.Themes.Default/Expander.xaml +++ b/src/Avalonia.Themes.Default/Expander.xaml @@ -15,7 +15,7 @@ BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> - + - + - + - + - + - + - +