IXRResourceManager::ResolveStringResource (Compact 2013)
3/28/2014
This method is called by XAML for Windows Embedded to load a string resource that is declared in XAML as a data-bound value for a text block.
Syntax
virtual BOOL STDMETHODCALLTYPE ResolveStringResource(
UINT ResourceID,
BSTR* pbstrString
) = 0;
Parameters
- ResourceID
[in] Resource ID of the static resource specified in the source XAML, which is res_str.
- pbstrString
[out] Pointer to the string that is loaded.
Return Value
Returns TRUE if the operation was successful; otherwise, returns FALSE.
Remarks
This method loads resources that are specified in XAML by using text binding, in which text blocks have bindings that associate a text property with a data property from a data-source object. You can use XAML text binding to specify UI strings for localization that are displayed in XAML for Windows Embedded applications that use multiple locales.
The following example code shows text binding in XAML:
Important
For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.
<TextBlock Text="{Binding res_str:12}" TextWrapping="Wrap" Opacity="0.3" VerticalAlignment="Center" FontSize="24"/>
In your custom implementation of this method, call LoadString to load the string. You must supply the module instance where the localized string table is located. Obtain this module instance by calling GetModuleHandle and supplying the resource DLL.
.NET Framework Equivalent
None.
Requirements
Header |
XamlRuntime.h |
sysgen |
SYSGEN_XAML_RUNTIME |