MainContent - rework
This commit is contained in:
		
							parent
							
								
									56cef22d26
								
							
						
					
					
						commit
						b01b4e42df
					
				@ -176,7 +176,7 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
 | 
				
			|||||||
		get
 | 
							get
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			return new StyleBuilder()
 | 
								return new StyleBuilder()
 | 
				
			||||||
				.AddStyle(StyleList)
 | 
									.AddStyle(StyleList?? "")
 | 
				
			||||||
				.AddStyle("width", Width, !string.IsNullOrWhiteSpace(Width) && !Fixed)
 | 
									.AddStyle("width", Width, !string.IsNullOrWhiteSpace(Width) && !Fixed)
 | 
				
			||||||
				.AddStyle("drawer-width", Width, !string.IsNullOrWhiteSpace(Width) && (!Fixed || Variant == DrawerVariant.Temporary))
 | 
									.AddStyle("drawer-width", Width, !string.IsNullOrWhiteSpace(Width) && (!Fixed || Variant == DrawerVariant.Temporary))
 | 
				
			||||||
				.AddStyle("height", Height, !string.IsNullOrWhiteSpace(Height))
 | 
									.AddStyle("height", Height, !string.IsNullOrWhiteSpace(Height))
 | 
				
			||||||
 | 
				
			|||||||
@ -1,20 +1,7 @@
 | 
				
			|||||||
@namespace Connected.Components
 | 
					@namespace Connected.Components
 | 
				
			||||||
@using Connected.Annotations;
 | 
					@using Connected.Annotations;
 | 
				
			||||||
@using Connected.Utilities;
 | 
					 | 
				
			||||||
@inherits UIComponent
 | 
					@inherits UIComponent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div @attributes="CustomAttributes" class="@Classname">
 | 
					<div @attributes="CustomAttributes" class="@CompiledClassList.Build()">
 | 
				
			||||||
    @ChildContent
 | 
					    @ChildContent
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
@code {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    protected string Classname =>
 | 
					 | 
				
			||||||
    new CssBuilder("main-content")
 | 
					 | 
				
			||||||
        .AddClass(AdditionalClassList)
 | 
					 | 
				
			||||||
     .Build();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    [Parameter]
 | 
					 | 
				
			||||||
    [Category(CategoryTypes.MainContent.Behavior)]
 | 
					 | 
				
			||||||
    public RenderFragment ChildContent { get; set; }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					using Connected.Utilities;
 | 
				
			||||||
 | 
					using Microsoft.AspNetCore.Components;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace Connected.Components;
 | 
				
			||||||
 | 
					public partial class MainContent
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						private CssBuilder CompiledClassList
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							get
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								return new CssBuilder("main-content")
 | 
				
			||||||
 | 
									 .AddClass(ClassList);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						[Parameter]
 | 
				
			||||||
 | 
						public RenderFragment ChildContent { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/// <summary>
 | 
				
			||||||
 | 
						/// A space separated list of class names, added on top of the default class list.
 | 
				
			||||||
 | 
						/// </summary>
 | 
				
			||||||
 | 
						[Parameter]
 | 
				
			||||||
 | 
						public string? ClassList { get; set; }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user