ebakhtin c930e8c704 first | преди 6 месеца | |
---|---|---|
.vs | преди 6 месеца | |
Model | преди 6 месеца | |
assets | преди 6 месеца | |
bin | преди 6 месеца | |
img | преди 6 месеца | |
obj | преди 6 месеца | |
App.xaml | преди 6 месеца | |
App.xaml.cs | преди 6 месеца | |
AssemblyInfo.cs | преди 6 месеца | |
MainWindow.xaml | преди 6 месеца | |
MainWindow.xaml.cs | преди 6 месеца | |
readme.md | преди 6 месеца | |
wpf_app.csproj | преди 6 месеца | |
wpf_app.csproj.user | преди 6 месеца | |
wpf_app.sln | преди 6 месеца |
XAML:
...
<ListBox
Grid.Row="1"
Grid.Column="1"
Background="White"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding ProductList}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel
HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border
BorderThickness="1"
BorderBrush="Black"
CornerRadius="5">
<Grid
Margin="10"
Width="300"
HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="64"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image
Width="64"
Height="64"
Source="{Binding ImageBitmap,TargetNullValue={StaticResource defaultImage}}"/>
<StackPanel
Grid.Column="1"
Margin="5"
Orientation="Vertical"
VerticalAlignment="Center">
<TextBlock
Text="{Binding Company}"/>
<TextBlock
Text="{Binding Title}"/>
</StackPanel>
<WrapPanel
Grid.Column="2"
VerticalAlignment="Center"
HorizontalAlignment="Right">
<Label
Content="Цена:"/>
<TextBlock
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="{Binding Price}"/>
</WrapPanel>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
...