我开发了一个使用MVVM(Prism v4.1)的Windows Phone应用程序。 当我将它部署到Emulator WVGA
或我的HTC 8X时,一切正常,但是当我将其部署到我的Lumia 800或使用Emulator 7.1
时,它无法正常工作。棱镜不能在WP7.1中工作,但在WP8中工作
这里是视图(模型)希望它有助于有点
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);
}
}
}
一切工作正常(关于其他的绑定的一部分意见)除了这个观点。
任何想法?
一旦显示视图,究竟是什么错误。你能提供更多细节吗?你有Convverters拼写错误,但它没有使用,你可以删除该命名空间。也许样式不适当地包括。 – 2013-03-13 07:06:44
问题是标签根本没有显示,但我知道EnglishPhrase属性已填充(即使应该显示该单词的空间缺失)。我伤心。它在WP8仿真器上工作,但不在WP7.1上 我在这个视图上也有一些按钮和其他东西,但绑定的非绑定在WP7.1中工作 – 2013-03-13 07:55:23