diff options
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs | 6 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs index 7dad34d..9430e25 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs @@ -59,7 +59,7 @@ namespace Xamarin.PropertyEditing.Mac existing.IntersectWith (this.brushTypeTable.Keys);
var removed = new HashSet<CommonBrushType> (this.brushTypeTable.Keys);
- removed.ExceptWith (existing);
+ removed.ExceptWith (ViewModel?.BrushTypes.Values ?? Array.Empty<CommonBrushType>());
foreach (var item in removed.Select (t => new { Type = t, Tab = TabView.Items[this.brushTypeTable[t]] }).ToArray ()) {
RemoveTabViewItem (item.Tab);
@@ -137,7 +137,9 @@ namespace Xamarin.PropertyEditing.Mac if (this.brushTypeTable.TryGetValue (ViewModel.SelectedBrushType, out int index)) { SelectedTabViewItemIndex = index; - }
+ this.filterResource.Hidden = ViewModel.SelectedBrushType != CommonBrushType.Resource; + } else
+ this.filterResource.Hidden = true;
this.inhibitSelection = false; } diff --git a/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs b/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs index 8fec0e1..162ca19 100644 --- a/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs +++ b/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs @@ -70,6 +70,13 @@ namespace Xamarin.PropertyEditing.Tests.MockControls colorSpaces: new[] { "RGB", "sRGB" }); AddProperty<CommonBrush> (this.brushPropertyInfo); + AddProperty<CommonBrush> (new MockBrushPropertyInfo ( + name: "SolidBrushNoResource", + valueSources: ValueSources.Default | ValueSources.Local, + category: null, + canWrite: true + )); + this.materialDesignBrushPropertyInfo = new MockBrushPropertyInfo ( name: "MaterialDesignBrush", category: null, |