Browse Source
Merge pull request #6849 from workgroupengineering/fixes/Issue_6848
fixes(DevTools): Ambiguous match found Exception
pull/6854/head
Tako
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
13 additions and
5 deletions
-
src/Avalonia.Diagnostics/Diagnostics/ViewModels/AvaloniaPropertyViewModel.cs
-
src/Avalonia.Diagnostics/Diagnostics/ViewModels/ClrPropertyViewModel.cs
-
src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs
-
src/Avalonia.Diagnostics/Diagnostics/ViewModels/PropertyViewModel.cs
|
|
|
@ -19,7 +19,7 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
Name = property.IsAttached ? |
|
|
|
$"[{property.OwnerType.Name}.{property.Name}]" : |
|
|
|
property.Name; |
|
|
|
|
|
|
|
DeclaringType = property.OwnerType; |
|
|
|
Update(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -50,6 +50,8 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
|
|
|
|
public override string Group => _group; |
|
|
|
|
|
|
|
public override System.Type? DeclaringType { get; } |
|
|
|
|
|
|
|
// [MemberNotNull(nameof(_type), nameof(_group), nameof(_priority))]
|
|
|
|
public override void Update() |
|
|
|
{ |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
{ |
|
|
|
Name = property.DeclaringType.Name + '.' + property.Name; |
|
|
|
} |
|
|
|
|
|
|
|
DeclaringType = property.DeclaringType; |
|
|
|
Update(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -55,6 +55,8 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
public override bool? IsAttached => |
|
|
|
default; |
|
|
|
|
|
|
|
public override System.Type? DeclaringType { get; } |
|
|
|
|
|
|
|
// [MemberNotNull(nameof(_type))]
|
|
|
|
public override void Update() |
|
|
|
{ |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
private bool _showInactiveStyles; |
|
|
|
private string? _styleStatus; |
|
|
|
private object _selectedEntity; |
|
|
|
private readonly Stack<(string Name, object Entry)> _selectedEntitiesStack = new(); |
|
|
|
private readonly Stack<(string Name,object Entry)> _selectedEntitiesStack = new(); |
|
|
|
private string _selectedEntityName; |
|
|
|
private string _selectedEntityType; |
|
|
|
|
|
|
|
@ -412,9 +412,12 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
property = _selectedEntity.GetType().GetProperty(selectedProperty.Name)?.GetValue(_selectedEntity); |
|
|
|
property = selectedEntity.GetType().GetProperties() |
|
|
|
.FirstOrDefault(pi => pi.Name == selectedProperty.Name |
|
|
|
&& pi.DeclaringType == selectedProperty.DeclaringType |
|
|
|
&& pi.PropertyType.Name == selectedProperty.Type) |
|
|
|
?.GetValue(selectedEntity); |
|
|
|
} |
|
|
|
|
|
|
|
if (property == null) return; |
|
|
|
_selectedEntitiesStack.Push((Name:selectedEntityName,Entry:selectedEntity)); |
|
|
|
NavigateToProperty(property, selectedProperty.Name); |
|
|
|
|
|
|
|
@ -15,6 +15,7 @@ namespace Avalonia.Diagnostics.ViewModels |
|
|
|
public abstract string Name { get; } |
|
|
|
public abstract string Group { get; } |
|
|
|
public abstract string Type { get; } |
|
|
|
public abstract Type? DeclaringType { get; } |
|
|
|
public abstract string Value { get; set; } |
|
|
|
public abstract string Priority { get; } |
|
|
|
public abstract bool? IsAttached { get; } |
|
|
|
|