Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Window x:Class="Exercise3.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:Exercise3"
- mc:Ignorable="d"
- Title="MainWindow" Height="550" Width="700">
- <Window.Resources>
- <DataTemplate x:Key="wrappere">
- <TextBlock TextWrapping="Wrap" Text="{Binding Path=Description}" ></TextBlock>
- </DataTemplate>
- </Window.Resources>
- <ScrollViewer>
- <StackPanel>
- <GroupBox Header="All games" Margin="10">
- <ListView x:Name="GamesListView" Margin="10" ItemsSource="{Binding}">
- <ListView.View>
- <GridView>
- <GridViewColumn Header="Name" Width="auto" DisplayMemberBinding="{Binding Path=Name}" ></GridViewColumn>
- <GridViewColumn Header="Description" Width="400" CellTemplate="{StaticResource wrappere}"></GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </GroupBox>
- <GroupBox x:Name="NewGameGroupBox" Header="Add a new game" Margin="10">
- <Grid>
- <Label Content="_Name" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Target="{Binding ElementName=NameTextBox}"/>
- <TextBox Text="{Binding Path=Name}" x:Name="NameTextBox" HorizontalAlignment="Left" VerticalAlignment="Top"
- Width="150" Height="25" Margin="100,10,0,0" />
- <Label Content="_Description" HorizontalAlignment="Left" Margin="10,50,0,0" VerticalAlignment="Top" Target="{Binding ElementName=DescriptionTextBox}"/>
- <TextBox TextWrapping="Wrap" AcceptsReturn="True" Language="nl-be" SpellCheck.IsEnabled="True" Text="{Binding Path=Description}" x:Name="DescriptionTextBox" HorizontalAlignment="Left" VerticalAlignment="Top"
- Width="300" Height="100" Margin="100,50,0,0" />
- <Button x:Name="AddNewGameButton" HorizontalAlignment="Left" Margin="10,170,10,10" VerticalAlignment="Top" Click="AddNewGameButton_Click">Add Game</Button>
- <TextBlock x:Name="ErrorMessageTextBlock" HorizontalAlignment="Left" Margin="100,170,10,10" VerticalAlignment="Top"
- Foreground="Red" FontSize="14"></TextBlock>
- </Grid>
- </GroupBox>
- </StackPanel>
- </ScrollViewer>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement