WP8 プロジェクトをユニバーサル アプリに変換しようとしています。LocalizedStrings に関する奇妙なエラーが発生しました。
多言語アプリ ツールキットを使用して翻訳を管理しています。ユニバーサル アプリをサポートする最新バージョン (4.0) に更新しました。
問題は、App.xaml で次のエラーが発生することです。「LocalizedStrings」という名前が名前空間「using:StayfilmUniversalApp」に存在しません。
そして、MainPage.xaml でも文句を言っていますが、他のページでは文句を言っています... MainPage.xaml では、タイプ LocalizedStrings が見つかりませんでした。LocalizedStrings を使用するコンポーネントを含む DataTemplate ブロック全体に青色の下線が引かれています。
<DataTemplate x:Key="TIT_WhatsNew">
<Grid Width="250" Height="52" Margin="0" HorizontalAlignment="Left">
<Rectangle Fill="White" HorizontalAlignment="Left" Height="3" Margin="0" VerticalAlignment="Top" Width="250" />
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding LocalizedResources.WHATSNEW, Mode=OneWay, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center" FontSize="21.333" FontStretch="ExtraCondensed" FontFamily="/Assets/Fonts/Frontage-regular.otf#Frontage Regular" />
<Rectangle Fill="White" HorizontalAlignment="Left" Height="3" Margin="0" VerticalAlignment="Bottom" Width="250" />
</Grid>
</DataTemplate>
ここに私の App.xaml があります:
<Application
x:Class="StayfilmUniversalApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:StayfilmUniversalApp"
RequestedTheme="Light">
<Application.Resources>
<ResourceDictionary>
<!--<local:LocalizedStrings x:Key="LocalizedStrings"/>-->
<local:LocalizedStrings xmlns:local="using:StayfilmUniversalApp" x:Key="LocalizedStrings" />
<Color x:Key="PhoneDisabledColor">#66FFFFFF</Color>
<SolidColorBrush x:Key="PhoneDisabledBrush" Color="{StaticResource PhoneDisabledColor}" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles\PhoneStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- Other resources if you have -->
</ResourceDictionary>
</Application.Resources>
および My LocalizedStrings.cs:
using StayfilmUniversalApp.Resources;
namespace StayfilmUniversalApp
{
/// <summary>
/// Provides access to string resources.
/// </summary>
public class LocalizedStrings
{
private static AppResources _localizedResources = new AppResources();
public AppResources LocalizedResources { get { return _localizedResources; } }
}
}