Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constructor overload for SliderOption<T> that allows specifying legend,data etc #3100

Closed
tznind opened this issue Dec 30, 2023 · 0 comments
Assignees
Labels
v2 For discussions, issues, etc... relavant for v2

Comments

@tznind
Copy link
Collaborator

tznind commented Dec 30, 2023

Is your feature request related to a problem? Please describe.

Sometimes it is preferable to initialize from the constructor rather than with Object Initializers. For example CodeDOM CodeObjectCreateExpression does not support object initializers.

Currently to construct a SliderOption<string> you would have to do:

new SliderOption<string> { Legend = "l1", LegendAbbr = new Rune('1'), Data = "Fun1" }

We should also support:

new SliderOption<string> ("l1",new Rune('1'),"Fun1" );

Describe the solution you'd like
Add constructor overload.

Describe alternatives you've considered
Code could declare a local variable for every option but this starts to get onerous.

var foo = new SliderOption<string>();
foo. Legend = "l1";
foo.LegendAbbr  = new Rune('1');
foo.Data =  "Fun1";
@tznind tznind added the v2 For discussions, issues, etc... relavant for v2 label Dec 30, 2023
@tznind tznind self-assigned this Dec 30, 2023
@tig tig closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 For discussions, issues, etc... relavant for v2
Projects
None yet
Development

No branches or pull requests

2 participants