Last active
October 21, 2017 10:08
-
-
Save andy51002000/eda297ed63a029a165183418b623352c to your computer and use it in GitHub Desktop.
Present Movies List. Click Button "Clear" will delete all data from view and database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page | |
x:Class="SimpleMVVM.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:SimpleMVVM" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
DataContext="{Binding Source= {StaticResource ViewModelLocator}, Path=MovieListViewModel}" | |
> | |
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="Auto"/> | |
</Grid.RowDefinitions> | |
<TextBlock Grid.Row="0" Text="Movie List" Margin="10" /> | |
<StackPanel Orientation="Vertical" Grid.Row="1"> | |
<ListBox Margin="10" | |
ItemsSource="{Binding Movies, Mode=TwoWay}" | |
SelectedItem="{Binding SelectedMovie, Mode=TwoWay}" | |
Height="250" | |
Width="Auto" | |
MaxWidth="450" | |
HorizontalAlignment="Left" | |
ScrollViewer.VerticalScrollBarVisibility="Auto" | |
> | |
<ListBox.ItemTemplate> | |
<DataTemplate> | |
<StackPanel Orientation="Vertical"> | |
<TextBlock Text="{Binding Name, Mode=TwoWay}"/> | |
<TextBlock Text="{Binding Price, Mode=TwoWay}"/> | |
</StackPanel> | |
</DataTemplate> | |
</ListBox.ItemTemplate> | |
</ListBox> | |
<Button Margin="10" Command="{Binding DeleteAllMoviesCommand}" Content="Clear all"/> | |
</StackPanel> | |
</Grid> | |
</Page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment