Windows phone 8 Windows Phone中的中继命令和弹出窗口
我目前正在为Windows Phone 8.0编写应用程序,但MVVM工具包中的RelayCommand light和popup存在问题 我在弹出窗口上有一个长列表选择器:Windows phone 8 Windows Phone中的中继命令和弹出窗口,windows-phone-8,mvvm,mvvm-light,relaycommand,Windows Phone 8,Mvvm,Mvvm Light,Relaycommand,我目前正在为Windows Phone 8.0编写应用程序,但MVVM工具包中的RelayCommand light和popup存在问题 我在弹出窗口上有一个长列表选择器: <Popup x:Name="popUp" Grid.Row="0" Grid.RowSpan="3" Opened="PopupOpened"> <Grid> <ScrollViewer Grid.Row="2" Margin="10">
<Popup x:Name="popUp" Grid.Row="0" Grid.RowSpan="3" Opened="PopupOpened">
<Grid>
<ScrollViewer Grid.Row="2" Margin="10">
<phone:LongListSelector ItemsSource="{Binding ItemsSelections}"
ItemTemplate="{StaticResource DetailsItemTemplate}" />
</ScrollViewer>
</Grid>
</Popup>
和项目的模板:
<DataTemplate x:Key="DetailsItemTemplate">
<Button VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="5,5,5,5"
Command="{Binding ElementName=LayoutRoot,Path=DataContext.ItemExecutionCommand}"
CommandParameter="{Binding Type}">
</Button>
</DataTemplate>
当我第一次打开弹出窗口时,一切正常,CanExecute返回false,按钮被禁用,禁用样式被应用(前景为灰色)。但是,当我关闭弹出窗口并再次打开时,按钮被禁用,但具有正常样式(前景为白色)。在每次弹出窗口打开后执行RaiseCanExecuteChanged方法没有帮助。
有人有这个问题吗