korzinka.xaml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <Page x:Class="test.korzinka"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:test"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="korzinka" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
  10. <Page.Resources>
  11. <DataTemplate x:Key="ListBookKorz">
  12. <Border BorderBrush="Black" BorderThickness="1" Width="1700">
  13. <StackPanel Uid="{Binding IdBook}" Orientation="Horizontal">
  14. <Image Height="100" Source="{Binding Image}"></Image>
  15. <StackPanel Orientation="Vertical">
  16. <StackPanel Orientation="Horizontal">
  17. <TextBlock Text="Название: "></TextBlock>
  18. <TextBlock Text="{Binding Title}"/>
  19. <TextBlock Text=" | Жанр: "></TextBlock>
  20. <TextBlock Text="{Binding Genre1.Genre1}"/>
  21. </StackPanel>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="Автор: "></TextBlock>
  24. <TextBlock Text="{Binding Authors.Name}"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal" Visibility="{Binding Visible}">
  27. <TextBlock Text="Цена: "></TextBlock>
  28. <TextBlock Text="{Binding Cost, StringFormat=0}" />
  29. <TextBlock Text=" руб."/>
  30. </StackPanel>
  31. <StackPanel Orientation="Horizontal">
  32. <TextBlock Text="Цена: "></TextBlock>
  33. <TextBlock Text="{Binding TotalPriseZak, StringFormat=0}" TextDecorations="{Binding decor}" Visibility="{Binding Visible2}"/>
  34. <TextBlock Text=" "/>
  35. <TextBlock Text="{Binding TotalPriseZakWithSale, StringFormat=0}"/>
  36. <TextBlock Text=" руб."/>
  37. </StackPanel>
  38. </StackPanel>
  39. <Button x:Name="delit" Content="Удалить позицию" Click="delit_Click" Uid="{Binding IdBook}"></Button>
  40. </StackPanel>
  41. </Border>
  42. </DataTemplate>
  43. </Page.Resources>
  44. <Grid>
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="30"/>
  47. <RowDefinition Height="209*"/>
  48. </Grid.RowDefinitions>
  49. <StackPanel Orientation="Horizontal" Grid.Row="0">
  50. <Button Content="На главную" Name="menu" Click="menu_Click" ></Button>
  51. <Button Content="Оформить заказ" Name="newZak" Click="newZak_Click"></Button>
  52. <Button Content="Очичтить корзину" Name="clear" Click="clear_Click"></Button>
  53. </StackPanel>
  54. <ListBox x:Name="ListZak" ItemTemplate="{StaticResource ListBookKorz}" Grid.Row="1" Visibility="Visible"></ListBox>
  55. </Grid>
  56. </Page>