3 implementations of IVisual
Microsoft.Maui.Controls (3)
Visuals\VisualMarker.cs (3)
37 internal sealed class MaterialVisual : IVisual { public MaterialVisual() { } } 38 public sealed class DefaultVisual : IVisual { public DefaultVisual() { } } 39 internal sealed class MatchParentVisual : IVisual { public MatchParentVisual() { } }
47 references to IVisual
Microsoft.Maui.Controls (47)
Cells\Cell.cs (3)
52 IVisual _effectiveVisual = Microsoft.Maui.Controls.VisualMarker.Default; 53 IVisual IVisualController.EffectiveVisual 65 IVisual IVisualController.Visual => Microsoft.Maui.Controls.VisualMarker.MatchParent;
EffectiveVisualExtensions.cs (3)
12 public static bool IsDefault(this IVisual visual) => visual == VisualMarker.Default; 14 public static bool IsMatchParent(this IVisual visual) => visual == VisualMarker.MatchParent; 16 public static bool IsMaterial(this IVisual visual) => false; // visual == VisualMarker.Material;
IVisualController.cs (2)
5 IVisual EffectiveVisual { get; set; } 6 IVisual Visual { get; }
Registrar.cs (1)
117 internal TRegistrable GetHandler(Type type, object source, IVisual visual, params object[] args)
Shell\BaseShellItem.cs (3)
200 IVisual _effectiveVisual = Microsoft.Maui.Controls.VisualMarker.Default; 201 IVisual IVisualController.EffectiveVisual 213 IVisual IVisualController.Visual => Microsoft.Maui.Controls.VisualMarker.MatchParent;
VisualElement\VisualElement.cs (11)
171 BindableProperty.Create(nameof(Visual), typeof(IVisual), typeof(VisualElement), VisualMarker.MatchParent, 174 static IVisual _defaultVisual = VisualMarker.Default; 175 IVisual _effectiveVisual = _defaultVisual; 178 /// Gets or sets a <see cref="IVisual"/> implementation that overrides the visual appearance of an element. This is a bindable property. 181 public IVisual Visual 183 get { return (IVisual)GetValue(VisualProperty); } 187 internal static void SetDefaultVisual(IVisual visual) => _defaultVisual = visual; 190 IVisual IVisualController.EffectiveVisual 1598 var newVisual = (IVisual)newValue; 1603 self.EffectiveVisual = (IVisual)newValue;
Visuals\VisualMarker.cs (4)
16 public static IVisual MatchParent { get; } = new MatchParentVisual(); 18 public static IVisual Default { get; } = new DefaultVisual(); 21 internal static IVisual Material { get; } = new MaterialVisual(); 29 var logger = Application.Current?.FindMauiContext()?.CreateLogger<IVisual>();
Visuals\VisualTypeConverter.cs (20)
25 static Dictionary<string, IVisual> _visualTypeMappings; 28 var mappings = new Dictionary<string, IVisual>(StringComparer.OrdinalIgnoreCase); 51 void ScanAllAssemblies(Dictionary<string, IVisual> mappings) 73 static void RegisterAllIVisualTypesInAssembly(Assembly assembly, Dictionary<string, IVisual> mappings) 81 if (typeof(IVisual).IsAssignableFrom(type) && type != typeof(IVisual)) 86 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Cannot scan assembly {assembly} for Visual types.", assembly.FullName); 90 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to load a dependent assembly for {assembly}. It cannot be scanned for Visual types.", assembly.FullName); 94 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to load a dependent assembly for {assembly}. Types cannot be loaded.", assembly.FullName); 98 static void RegisterFromAttributes(Assembly assembly, Dictionary<string, IVisual> mappings) 106 var visual = CreateVisual(attribute.Visual); 116 Dictionary<string, IVisual> mappings) 118 IVisual registeredVisual = CreateVisual(visual); 137 static IVisual CreateVisual( 142 return (IVisual)Activator.CreateInstance(visualType); 146 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to register {visualType} please add a public default constructor", visualType.ToString()); 160 if (_visualTypeMappings.TryGetValue(strValue, out IVisual returnValue)) 165 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning( 173 throw new XamlParseException($"Cannot convert \"{strValue}\" into {typeof(IVisual)}"); 178 if (value is not IVisual visual)