Advertisement
Guest User

oef3xaml

a guest
Nov 12th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <Window x:Class="Exercise3.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:Exercise3"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="550" Width="700">
  9. <Window.Resources>
  10. <DataTemplate x:Key="wrappere">
  11. <TextBlock TextWrapping="Wrap" Text="{Binding Path=Description}" ></TextBlock>
  12. </DataTemplate>
  13. </Window.Resources>
  14. <ScrollViewer>
  15. <StackPanel>
  16. <GroupBox Header="All games" Margin="10">
  17. <ListView x:Name="GamesListView" Margin="10" ItemsSource="{Binding}">
  18. <ListView.View>
  19. <GridView>
  20. <GridViewColumn Header="Name" Width="auto" DisplayMemberBinding="{Binding Path=Name}" ></GridViewColumn>
  21. <GridViewColumn Header="Description" Width="400" CellTemplate="{StaticResource wrappere}"></GridViewColumn>
  22. </GridView>
  23. </ListView.View>
  24.  
  25. </ListView>
  26. </GroupBox>
  27. <GroupBox x:Name="NewGameGroupBox" Header="Add a new game" Margin="10">
  28. <Grid>
  29. <Label Content="_Name" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Target="{Binding ElementName=NameTextBox}"/>
  30. <TextBox Text="{Binding Path=Name}" x:Name="NameTextBox" HorizontalAlignment="Left" VerticalAlignment="Top"
  31. Width="150" Height="25" Margin="100,10,0,0" />
  32.  
  33. <Label Content="_Description" HorizontalAlignment="Left" Margin="10,50,0,0" VerticalAlignment="Top" Target="{Binding ElementName=DescriptionTextBox}"/>
  34. <TextBox TextWrapping="Wrap" AcceptsReturn="True" Language="nl-be" SpellCheck.IsEnabled="True" Text="{Binding Path=Description}" x:Name="DescriptionTextBox" HorizontalAlignment="Left" VerticalAlignment="Top"
  35. Width="300" Height="100" Margin="100,50,0,0" />
  36.  
  37. <Button x:Name="AddNewGameButton" HorizontalAlignment="Left" Margin="10,170,10,10" VerticalAlignment="Top" Click="AddNewGameButton_Click">Add Game</Button>
  38. <TextBlock x:Name="ErrorMessageTextBlock" HorizontalAlignment="Left" Margin="100,170,10,10" VerticalAlignment="Top"
  39. Foreground="Red" FontSize="14"></TextBlock>
  40. </Grid>
  41. </GroupBox>
  42. </StackPanel>
  43. </ScrollViewer>
  44. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement