我使用 MVVM (Prism v4.1) 开发了一个 Windows Phone 应用程序。当我将它部署到我的 HTC 8X 时一切正常,但是当我将它部署Emulator WVGA
到我的 Lumia 800 或使用Emulator 7.1
它时它无法正常工作。
这是视图(模型)的一部分,希望对您有所帮助
View
<phone:PhoneApplicationPage
x:Class="LearnByTranslate.Views.PhrasePracticeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:converter="clr-namespace:LearnByTranslate.Infrastructure.Convverters"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<Grid x:Name="LayoutRoot" Background="Transparent">
<ScrollViewer Margin="24,0,24,72" Grid.Row="1">
<StackPanel x:Name="stkPracticeContent" Margin="0">
<TextBlock x:Name="txtTextToTranslate" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding EnglishPhrase,Mode=TwoWay}" FontSize="40" FontStyle="Normal" VerticalAlignment="Top" Style="{StaticResource EnglishSentenceStyle}" FontFamily="Segoe WP Light">
<TextBlock.Foreground>
<SolidColorBrush Color="{StaticResource PhoneForegroundColor}"/>
</TextBlock.Foreground>
</TextBlock>
</StackPanel>
</ScrollViewer>
</Grid>
</phone:PhoneApplicationPage>
ViewModel
class PhrasePracticeViewModel : NotificationObject
{
private string _englishPhrase;
public PhrasePracticeViewModel()
{
}
public string EnglishPhrase
{
get { return _englishPhrase; }
set
{
_englishPhrase = value;
RaisePropertyChanged(() => EnglishPhrase);
}
}
}
除此视图外,一切正常(关于其他视图中的绑定)。
有任何想法吗?