Skip to content

Commit

Permalink
fixed ToType method
Browse files Browse the repository at this point in the history
  • Loading branch information
sglienke committed Jun 15, 2015
1 parent 96f2940 commit 3972135
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SimpleMVVM.Observable.pas
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ implementation

function TValueHelper.ToType<T>: T;
begin
// hardcode some simple conversions for demo purpose - use Spring4D value converter later
case Kind of
tkUString:
case PTypeInfo(System.TypeInfo(T)).Kind of
tkInteger: PInteger(@Result)^ := StrToInt(AsString);
end;
end;
if not TryAsType<T>(Result) then
// hardcode some simple conversions for demo purpose - use Spring4D value converter later
case Kind of
tkUString:
case PTypeInfo(System.TypeInfo(T)).Kind of
tkInteger: PInteger(@Result)^ := StrToInt(AsString);
end;
end;
end;



{$REGION 'TObservableBase'}

class constructor TObservableBase.Create;
Expand Down

0 comments on commit 3972135

Please sign in to comment.