我正在開發一個Windows Phone 7應用程序,並且我有兩個xaml頁面。從第一個,我嵌入了兩個應用程序欄鏈接,從圖庫中選擇圖像或使用相機捕捉圖像。我希望在第一頁上選擇的圖像顯示在第二頁上,應用欄按鈕顯示確認是或否。到目前爲止,我在第一頁(barcodeImage)上有一個圖像控件,它會根據選擇進行更新。是否可以在page.xaml.cs中訪問外部類的成員變量?
MainPage.xaml中
<controls:PanoramaItem Header="welcome">
<ScrollViewer Name="sv1" VerticalScrollBarVisibility="Auto">
<StackPanel Height="1100">
<TextBlock TextWrapping="Wrap">Random text here.
</TextBlock>
<Grid x:Name="Grid2" Grid.Row="1" Margin="12,0,12,0">
<Image Height="150" Margin="28,30,168,0" Name="barcodeImage" Stretch="Fill" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" />
</Grid>
</StackPanel>
</ScrollViewer>
</controls:PanoramaItem>
MainPage.xaml.cs中
void cameraCaptureTask_Completed(object sender, PhotoResult e)
{
if (e.TaskResult == TaskResult.OK)
{
BitmapImage bmp = new BitmapImage();
bmp.SetSource(e.ChosenPhoto);
barcodeImage.Source = bmp;
}
}
Confirm.xaml
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image Margin="64,36,57,100" x:Name="barcodeImageFinal" Stretch="Fill" />
</Grid>
我想barcodeImageFinal顯示最終的位圖。我該如何做這項工作?感謝您的期待:)
我不明白標題是如何與你所描述的相關的。或者你問的問題是什麼。 – 2010-12-13 11:15:40
我相信這個問題是我的問題的一個可能的解決方案,在上面的正文中概述。當然,我願意接受替代品。 – Freakishly 2010-12-14 00:18:42