在满足某个条件后,我想在 ListBox 上放置一个 Popup。当我在以下代码中执行此操作时,我在页面构造函数中得到了XamlParseException
一个InitializeComponent()
。我不确定为什么?
EditPage.xaml
<Grid>
<ListBox Name="ListBoxEffects" SelectionMode="Single" ItemsSource="{Binding}" Margin="{Binding}" toolkit:TiltEffect.IsTiltEnabled="True" SelectionChanged="ListBox_SelectionChanged" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel ItemWidth="146" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Margin="12,0,0,24" >
<Image Source="{Binding Thumbnail}" Width="134" Height="134" />
<TextBlock Text="{Binding Name}" TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeNormal}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Popup x:Name="trialPopup">
<Border Margin="3" BorderBrush="{StaticResource PhoneForegroundBrush}">
<StackPanel Background="FF1BA1E2">
<TextBlock Text="Do you wish to purchase the application?" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal" Margin="0,10">
<Button x:Name="purchaseButton" Content="purchase" Click="popupButton_Click"/>
<Button x:Name="cancelButton" Content="cancel" Click="popupButton_Click"/>
</StackPanel>
</StackPanel>
</Border>
</Popup>
</Grid>
出于测试目的,我只是试图在导航到 EditPage 时立即显示弹出窗口,以便我可以看到它的外观和主题,但在生产中这只会在满足特定要求后显示。我如何才能真正测试看到 ListBox 上的弹出显示?