vanille.
vanille.
CC#
Created by M. on 1/15/2024 in #help
✅ How to Retrieve the Selected Item Value from a ComboBox in C# (AvaloniaUI)
22 replies
CC#
Created by M. on 1/15/2024 in #help
✅ How to Retrieve the Selected Item Value from a ComboBox in C# (AvaloniaUI)
This looks to be it, though it's a generic object? type so I'm not exactly sure what you want out of it. Are you looking to get the value of a specific field on the object or do you just need the object? https://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/SelectingItemsControl/F3D6C726
22 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
Thank you for the help though. mikuarigathanks
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
I'll just do it the original way I had planned, making inherited classes like LerpableColor : Lerpable<Color>.
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
MarinePensive
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
...I don't understand this answer.
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
Color.Lerp() is already a member of the class.
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
Still having a conversion issue, mainly with setting color1 to _value1.
15 replies
CC#
Created by vanille. on 1/15/2024 in #help
Change function behavior depending on class' generic type.
(Color is from Microsoft.Xna.Framework)
public T Lerp(float amount)
{
if (typeof(T) == typeof(Color)) {
return Color.Lerp(_value1, _value2, amount);
}
return amount > 0.5 ? _value2 : _value1;
}
public T Lerp(float amount)
{
if (typeof(T) == typeof(Color)) {
return Color.Lerp(_value1, _value2, amount);
}
return amount > 0.5 ? _value2 : _value1;
}
Can't, since if i have it inside of the function, the compiler won't be able to convert T into Color.
15 replies