1. John is developing a windows store Store app for viewing images. He has created the UI of the app,
as shown in the following figure.
Ans:= (XAML Code)
<ViewBox>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="Image List" HorizontalAlignment="Left" Mergin="10,10,0,0" BorderThickness="0" FontSize="24" Backround="Blue" VerticalAlignment="Top" Width="315"/>
<ListBox N:Name="IstboxPictureList" HorizontalAlignment="Left" Height="697" Margin="10,61,0,0" VerticalAlignment="Top" width="315" SelectionChanged="IstboxPictureList_SelectionChanged"/>
<Button Content="Image Preview" HorizontalAlignment="Left" Mergin="346,10,0,0" BorderThickness="0" FontSize="24" Background="Blue" VerticalAlignment="Top" Width="1010"/>
<Button IsEnabled="False" HorizontalAlignment="Left" Height="697" Margin="346,10,0,0" VerticalAlignment="Top" Width="1010" />
<Image x:Name="imgPreview" Source="Assets/1.jpg" Stretch="Uniform"></Image>
</Button>
</ViewBox>
(CCS Code)
using Windows.UI.Xaml.Media.Imaging;
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
throw new NotImplementedException();
}
public void loadPictureList();
{
for (int i=1; i < 9; i++)
{
IstboxPictureList.SelectedIndexz = 0;
}
}
/////////////// private void IstboxPictureList_selectionChanged(object, SelectionChangedEventArgs);
{
imgPreview.Source = new BitmapImage("as-appx:///Assets/"+lst)
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
loadPictureList();
}
}
}
as shown in the following figure.
Ans:= (XAML Code)
<ViewBox>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="Image List" HorizontalAlignment="Left" Mergin="10,10,0,0" BorderThickness="0" FontSize="24" Backround="Blue" VerticalAlignment="Top" Width="315"/>
<ListBox N:Name="IstboxPictureList" HorizontalAlignment="Left" Height="697" Margin="10,61,0,0" VerticalAlignment="Top" width="315" SelectionChanged="IstboxPictureList_SelectionChanged"/>
<Button Content="Image Preview" HorizontalAlignment="Left" Mergin="346,10,0,0" BorderThickness="0" FontSize="24" Background="Blue" VerticalAlignment="Top" Width="1010"/>
<Button IsEnabled="False" HorizontalAlignment="Left" Height="697" Margin="346,10,0,0" VerticalAlignment="Top" Width="1010" />
<Image x:Name="imgPreview" Source="Assets/1.jpg" Stretch="Uniform"></Image>
</Button>
</ViewBox>
(CCS Code)
using Windows.UI.Xaml.Media.Imaging;
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
throw new NotImplementedException();
}
public void loadPictureList();
{
for (int i=1; i < 9; i++)
{
IstboxPictureList.SelectedIndexz = 0;
}
}
/////////////// private void IstboxPictureList_selectionChanged(object, SelectionChangedEventArgs);
{
imgPreview.Source = new BitmapImage("as-appx:///Assets/"+lst)
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
loadPictureList();
}
}
}
No comments:
Post a Comment