I am having problems retrieving items from from the local data store. I insert using this:
ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings;
auto values = localSettings->Values;
int boolValue = lua_toboolean( L, 2 );
values->Insert( key, dynamic_cast<PropertyValue^>( PropertyValue::CreateBoolean( boolValue != 0 ) ) );
I try to retrieve like this:
ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings;
auto values = localSettings->Values;
IPropertyValue^ prop = dynamic_cast<IPropertyValue^>( localSettings->Values->Lookup( key ) );
Type^ type = prop->GetType();
TypeCode tc = Type::GetTypeCode( type );
switch ( tc ) {
However tc is always Object and not TypeCode::Boolean like I expect. I realize I can cast it to Boolean or whatever and probably get it to work, but this is test code and the real code is only asked to retrieve a key and has no idea the type stored
there so I must figure it out at read time.
Can someone tell me what I am missing here?
Regards, Guy