YngveHestem.GenericParameterCollection.RadzenBlazor
1.0.0-beta06
See the version list below for details.
dotnet add package YngveHestem.GenericParameterCollection.RadzenBlazor --version 1.0.0-beta06
NuGet\Install-Package YngveHestem.GenericParameterCollection.RadzenBlazor -Version 1.0.0-beta06
<PackageReference Include="YngveHestem.GenericParameterCollection.RadzenBlazor" Version="1.0.0-beta06" />
paket add YngveHestem.GenericParameterCollection.RadzenBlazor --version 1.0.0-beta06
#r "nuget: YngveHestem.GenericParameterCollection.RadzenBlazor, 1.0.0-beta06"
// Install YngveHestem.GenericParameterCollection.RadzenBlazor as a Cake Addin #addin nuget:?package=YngveHestem.GenericParameterCollection.RadzenBlazor&version=1.0.0-beta06&prerelease // Install YngveHestem.GenericParameterCollection.RadzenBlazor as a Cake Tool #tool nuget:?package=YngveHestem.GenericParameterCollection.RadzenBlazor&version=1.0.0-beta06&prerelease
GenericParameterCollection.RadzenBlazor
This provides controls for using GenericParameterCollection in the Blazor by using Radzen.Blazor.
How to use this package
The easiest way to use the package is to download it from nuget: https://www.nuget.org/packages/YngveHestem.GenericParameterCollection.RadzenBlazor.
Initial setup of Radzen
This package uses Radzen, including ToolTip-functionality. This must be set up correctly in the target project. If you are using Radzen already in the project, you will most likely not need to do anything, or eventually very little. See Radzen.Blazor's Getting Started-guide for what you eventually need to do.
Main features/controls
ParameterCollectionView
This is a Blazor-component. This is the main control that handles editing a given ParameterCollection object.
Properties and events
Here is a list of properties and events of the ParameterCollectionView-component.
ParameterCollection
Set this to the ParameterCollection the component should render.
Mark that the component will not automatically update the given ParameterCollection. To get the new value you need to either use the Get of this property, or using the NewParameterCollection-property you get in the OnChange-event.
Options
This property let you set customized Options for how the ParameterCollectionView should look and behave.
OnChange-event
This event is triggered each time the user do a change in the component.
When the event is triggered you will get an object that will contain both the new ParameterCollection, and the key to the parameter that was changed.
Mark: If you use this OnChange-event, you must currently manually set the new ParameterCollection to the ParameterCollection that is referenced in the component before the OnChange-event has exited. If not you may see that Blazor reloads the last version of the ParameterCollection.
CustomParameterComponents
Here you can define a list of custom comonent definitions.
This can be good to use if you for instance want a color picker for picking some colors, or have your own component you want to use for some parameter.
CustomConverters
Do you have some custom converters you need to use for converting some custom value, or want to change how some value is converted in the ParameterCollectionView? Then you can define a list of theese here.
Example code
The example-code below sets the ParameterCollection inside a RadzenCard that also has a heading with the text "Parameters". This is gotten from the TestProject. See that to get even more understanding by how it is used.
<Radzen.Blazor.RadzenCard>
<Radzen.Blazor.RadzenText TextStyle="Radzen.Blazor.TextStyle.DisplayH2">Parameters</Radzen.Blazor.RadzenText>
<ParameterCollectionView @ref="_parameterCollectionView" ParameterCollection="@_parameters" Options="@_options" OnChange="@(args => {
_parameters = args.NewParameterCollection;
Console.WriteLine($"{DateTime.Now}: ParameterCollection got update. Parameter updated was {args.ParameterKey ?? string.Empty}.");
})"></ParameterCollectionView>
</Radzen.Blazor.RadzenCard>
Options
The controls let you provide a ParameterCollectionViewOptions. Here you can define some customisation of how the control looks and works. Most are both self explanatory and well documented in code. Most of theese options can also be set for a specific parameter if the option AdditionalInfoWillOverride is set to true (default is true). Then one or more of the given parameters below can be given in a parameters additionalInfo.
Different options
Here is a list of parameters that can either be defined in ParameterCollectionPanelOptions or as a ParameterCollection (some can only be given in one, while many can be given both ways).
If you define this in a ParameterCollection-ParameterType, the changes will affect all parameters in that ParameterCollection.
Variable name in option-class | Parameter key | Type | Description | Default value in option-class |
---|---|---|---|---|
AdditionalInfoWillOverride | additionalInfoWillOverride | bool | Can parameters from a ParameterCollection, like AdditionalInfo from a parameter, override the values defined in this options-object. Mark that if this is set to false in the Options-object that it uses as a base, this will have no effect. | true |
TooltipOptions | tooltipOptions | TooltipOptions | Tooltip options for the form elements. | null |
TooltipOptionsFieldSet | tooltipOptionsFieldSet | TooltipOptions | Tooltip options for any field sets (like any ParameterCollection-entries with default rendering). | null |
ShowParameterNameAsHumanReadable | humanReadable | bool | Convert the parameter name to a human readable format. If set to false, the name will be shown as written, while if set to true, it will be altered to be read easily by a human, like setting first character to an upper character. Mark that this will only have an effect if it is the parameter key that is used. If another name is given, that will always be written as is. | True |
ReadOnly | readOnly | bool | If true, the control that shows the parameters value should be read only/disabled | False |
ElementsDesignVariant | elementsDesignVariant | Variant | Specifies what the design variant should be used on the controls. | Outlined |
AllowFloatingLabel | allowFloatingLabel | bool | Specifies if the form labels are floating or not. | true |
ReadableParameterTextKey | readableParameterTextKey | string | Specifies a parameter key to a parameter in a parameters additional info to use instead of the parameters key to show to the user. If the specified parameter can not be found (or converted to string), the given parameter's key is instead used. | name |
TooltipParameterTextKey | tooltipParameterTextKey | string | Specifies a parameter key to a parameter in a parameters additional info to use for a tooltip. | tooltip |
MinNumber | minNumber | decimal | Specifies what the lowest number that can be entered in a number-field is. | decimal.MinValue |
MaxNumber | maxNumber | decimal | Specifies what the highest number that can be entered in a number-field is. | decimal.MaxValue |
StepInteger and StepDecimal | step | decimal | Defines how much a number (both integers and decimals) should increment/decrement with if the increment/decrement buttons are used | if int, 1, if a decimal-number, 0.1 |
StepInteger | stepInt | int | Specifies how much the gui should increment the value on an int value if the step-button is pressed. | 1 |
StepDecimal | stepDecimal | decimal | Specifies how much the gui should increment the value on a decimal value if the step-button is pressed. | 0.1 |
PlaceholderText | placeholder | string | Specifies the placeholder text on controls that support that. | string.Empty |
IsPassword | isPassword | bool | Specifies if strings should be shown as password (without readable characters). | false |
MaxNumberOfCharacters | maxChars | long? | Specifies max number of characters that can be given in a text. | null |
NumberOfRowsInTextArea | textareaRows | int | Specifies the number of rows a textarea will show. | 5 |
NumberOfColumnsInTextArea | textareaColumns | int | Specifies the number of columns (characters) a textarea will show horizontally. | 100 |
AcceptedMimeTypes | acceptedMimeTypes | string[] | Specifies what mime types are accepted when selecting file. | null |
ChooseFileText | chooseFileText | string | Specifies the text to show on the Choose file button. | Choose file |
DeleteFileText | deleteFileText | string | Specifies the text to show on the Delete file button. | Delete |
MaxFileSize | maxFileSize | int | Specifies the max file size allowed. | 5 * 1024 * 1024 |
FilePreviewHeight | previewHeight | int | Specifies the height of the file preview. | 300 |
FilePreviewWidth | previewWidth | int | Specifies the width of the file preview. | 500 |
MinDate | minDate | DateTime | The earliest date that is possible to pick. | DateTime.Today.AddYears(-1000) |
MaxDate | maxDate | DateTime | The latest date that is possible to pick. | DateTime.Today.AddYears(1000) |
DateTimeFormat | dateTimeFormat | string | Specifies the time format to be shown in DateTime-parameters. | g |
DateFormat | dateFormat | string | Specifies the time format to be shown in Date-parameters. | d |
HoursStep | hoursStep | decimal | Specifies how much the gui should increment the hour when the hour step is clicked. | 1.0 |
MinutesStep | minutesStep | decimal | Specifies how much the gui should increment the minute when the minute step is clicked. | 1.0 |
SecondsStep | secondsStep | decimal | Specifies how much the gui should increment the second when the second step is clicked. | 1.0 |
ShowCalenderWeek | showCalendarWeek | bool | Show the given week in the calendar. | true |
CalendarWeekTitle | calendarWeekTitle | string | Specifies the title of the week-column. | # |
MaxSelectedLabels | maxSelectedLabels | int | Specifies the maximum number of selected labels to show in the DropDownList. | 4 |
ShowLabelsAsChips | showLabelsAsChips | bool | Specifies if you want the labels when seleecting multiple in a DropDownList should look likee chips instead of normal labels. | false |
SelectedItemsText | selectedItemsText | string | Specifies the text shown after the number of items selected when selecting multiple items in a DropDownList. | items selected |
SelectAllItemsText | selectAllItemsText | string | Specifies the text shown besides the checkmark to select all items when selecting multiple items in a DropDownList. | string.Empty |
BoolControlToUse | boolControl | BoolControl | Specifies what type of bool control to use. | Switch |
UseVirtualizationOnList | useVirtualizationOnList | bool | Specifies if lists should be virtualized. If not, the list will be paged. | true |
ListPageSize | listPageSize | int | Specifies the size of each page if the list is paged. | 5 |
AddEntryToListText | addEntryToListText | string | Specifies the text on the button to add a new object to the list. | Add |
DeleteEntryFromListText | deleteEntryFromListText | string | Specifies the text on the button to delete the given object from the list. | Delete |
DeleteEntryFromListAriaDescription | deleteEntryFromListAriaDescription | string | Specifies the text used to describe the delete button on the given entry in a list for screen readers. You can use {0} to get the current number the entry are in the list, use {1} to get the parameters viewable name and {2} to get the current value. | Delete entry number {0} from the list in parameter "{1}". The entry has the value "{2}". |
AddEntryToListAriaDescription | addEntryToListAriaDescription | string | Specifies the text used to describe the add button to add a new entry in a list for screen readers. You can use {0} to get the parameters viewable name. | Add a new entry to the list in parameter "{0}". |
defaultValue | TValue (Generic baseed on value (IEnumerable)) | This is used on IEnumerable-types to define their Default-value (which is their initial state when adding new value). | If not defined, this will either be default(TValue) or String.Empty if TValue is string or DateTime.Now if TValue is DateTime. |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.6)
- Radzen.Blazor (>= 4.32.6)
- YngveHestem.GenericParameterCollection (>= 1.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.5 | 106 | 11/12/2024 |
1.0.4 | 94 | 11/12/2024 |
1.0.3 | 96 | 10/27/2024 |
1.0.2 | 105 | 7/11/2024 |
1.0.1 | 109 | 6/26/2024 |
1.0.0 | 116 | 6/14/2024 |
1.0.0-beta06 | 70 | 6/9/2024 |
1.0.0-beta05 | 89 | 5/1/2024 |
1.0.0-beta04 | 92 | 4/24/2024 |
1.0.0-beta03 | 91 | 4/23/2024 |
1.0.0-beta02 | 84 | 4/22/2024 |
1.0.0-beta01 | 89 | 4/21/2024 |
- Updated Radzen.Blazor to version 4.32.6.
- Updated TargetFramework to net8.0 as net7.0 is now EOL.
- Changed the code so MouseEnter-event on a parameter is only set if it should show a tooltip. This made the package noticably more performant.
- Changed how the parameter-area of an IEnumerable of ParameterCollection is rendered, so it's better visually. This includes adding the delete-button for this stright below the given item, instead of floating on top.
- Changed so the Delete-button on ienumerable-parameters is not only disabled when in ReadOnly-mode, but also not added at all (like the add-button).