1

I'm currently writing app for Windows Phone 8.0 and I have a problem with RelayCommand from MVVM Toolkit light and popup.

I have a LongListSelector on the popup:

<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>

And item's template:

<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>

When I open popup for the first time, everything works fine, CanExecute returns false, buttons are disabled and the disable style is applied (foreground is gray). But, when I close popup and open again, buttons are disabled, but have normal style (foreground is white). Executing RaiseCanExecuteChanged method after every popup opening does not help. Anyone has this problem?

Nathan
  • 8,093
  • 8
  • 50
  • 76
Thomas
  • 11
  • 1

0 Answers0