File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
examples/Demo/Shared/Components Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 2626 string header = Properties .Any (x => x .IsParameter ) ? " Parameters" : " Properties" ;
2727 <h4 id =" @(_id + " _properties " )" >@header </h4 >
2828 <div class =" docgrid" >
29- <FluentDataGrid Items =" @this.Properties.AsQueryable()" GridTemplateColumns =" 1fr 1fr 0.5fr 2fr" >
29+ <FluentDataGrid Items =" @this.Properties.AsQueryable()" GridTemplateColumns =" 1fr 1fr 0.7fr 2fr" >
3030 <TemplateColumn Title =" Name" ><code >@context.Name </code ></TemplateColumn >
3131 <TemplateColumn Title =" Type" >
3232 @context.Type
9797 </FluentDataGrid >
9898 </div >
9999 }
100- </div >
100+ </div >
Original file line number Diff line number Diff line change 11using System . Diagnostics . CodeAnalysis ;
22using System . Reflection ;
33using Microsoft . AspNetCore . Components ;
4+ using Microsoft . FluentUI . AspNetCore . Components ;
45
56namespace FluentUI . Demo . Shared . Components ;
67
@@ -109,13 +110,26 @@ private IEnumerable<MemberDescription> GetMembers(MemberTypes type)
109110 // Parameters/properties
110111 if ( ! isEvent )
111112 {
113+ var defaultVaue = "" ;
114+ if ( propertyInfo . PropertyType . IsValueType || propertyInfo . PropertyType == typeof ( string ) )
115+ {
116+ defaultVaue = obj ? . GetType ( ) . GetProperty ( propertyInfo . Name ) ? . GetValue ( obj ) ? . ToString ( ) ;
117+ }
118+ else if ( propertyInfo . PropertyType == typeof ( Icon ) )
119+ {
120+ if ( obj ? . GetType ( ) . GetProperty ( propertyInfo . Name ) ? . GetValue ( obj ) is Icon icon )
121+ {
122+ defaultVaue = $ "{ icon . Variant } .{ icon . Size } .{ icon . Name } ";
123+ }
124+ }
125+
112126 members . Add ( new MemberDescription ( )
113127 {
114128 MemberType = MemberTypes . Property ,
115129 Name = propertyInfo . Name ,
116130 Type = propertyInfo . ToTypeNameString ( ) ,
117131 EnumValues = GetEnumValues ( propertyInfo ) ,
118- Default = propertyInfo . PropertyType . IsValueType ? obj ? . GetType ( ) . GetProperty ( propertyInfo . Name ) ? . GetValue ( obj ) ? . ToString ( ) : "" ,
132+ Default = defaultVaue ,
119133 Description = CodeComments . GetSummary ( Component . Name + "." + propertyInfo . Name ) ?? CodeComments . GetSummary ( Component . BaseType ? . Name + "." + propertyInfo . Name ) ,
120134 IsParameter = isParameter ,
121135 } ) ;
You can’t perform that action at this time.
0 commit comments