mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-21 06:45:32 -06:00
Fixed issue with casting to the same type.
This commit is contained in:
parent
9e213aac55
commit
efddc4fa24
1 changed files with 8 additions and 1 deletions
|
|
@ -28,7 +28,14 @@ namespace Qml.Net.Extensions
|
|||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
var item = value.GetItemAtIndex(i);
|
||||
list.Add((T)destinationConverter.ConvertFrom(null, CultureInfo.InvariantCulture, item));
|
||||
if (item is T casted)
|
||||
{
|
||||
list.Add(casted);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add((T) destinationConverter.ConvertFrom(null, CultureInfo.InvariantCulture, item));
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue