Browse Source

Реализован интерфейс частично

ra5um1st 2 years ago
parent
commit
d9d7b830f1

+ 66 - 6
WPF.Framework/MainWindow.xaml

@@ -22,24 +22,84 @@
         </Grid.RowDefinitions>
 
         <Grid Grid.Row="0">
-            
+            <Grid.RowDefinitions>
+                <RowDefinition Height="auto"/>
+                <RowDefinition Height="auto"/>
+            </Grid.RowDefinitions>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto"/>
+                <ColumnDefinition Width="2*"/>
+                <ColumnDefinition Width="1*"/>
+                <ColumnDefinition Width="1*"/>
+            </Grid.ColumnDefinitions>
+            <StackPanel Orientation="Horizontal"
+                        Margin="10">
+                <Image Source="Resources/Приятный шелест.png" 
+                       MaxWidth="50"
+                       Margin="0 0 10 0"/>
+                <TextBlock Text="Список агентов"
+                           VerticalAlignment="Center"
+                           FontSize="24"/>
+            </StackPanel>
+            <TextBox Grid.Column="1"
+                     VerticalAlignment="Center"
+                     Margin="5"
+                     Padding="2"/>
+            <ComboBox Grid.Column="2"
+                      VerticalAlignment="Center"
+                      Margin="5"
+                      SelectedIndex="0"
+                      ItemsSource="{Binding AgentsSortingDictionary}"
+                      SelectedValuePath="Key"
+                      DisplayMemberPath="Value"/>
+            <ComboBox Grid.Column="3"
+                      VerticalAlignment="Center"
+                      Margin="5"
+                      ItemsSource="{Binding AgentTypeFilterDictionary}"
+                      SelectedValuePath="Key"
+                      DisplayMemberPath="Value"/>
         </Grid>
 
         <Grid Grid.Row="1">
-            <ListBox ItemsSource="{Binding AgentsCollectionView}">
+            <ListBox x:Name="ListBox"
+                     ItemsSource="{Binding AgentsCollectionView}">
                 <ListBox.ItemTemplate>
                     <DataTemplate>
                         <Grid>
-                            <
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="1*"/>
+                                <ColumnDefinition Width="5*"/>
+                                <ColumnDefinition Width="auto"/>
+                            </Grid.ColumnDefinitions>
+                            <Image Grid.Column="0"
+                                   Source="{Binding Logo, FallbackValue='Resource/no_picture.png'}"/>
+                            <StackPanel Grid.Column="1">
+                                <StackPanel Orientation="Horizontal">
+                                    <TextBlock Text="{Binding AgentType.Title, StringFormat='{}{0} | '}"/>
+                                    <TextBlock Text="{Binding Title}"/>
+                                </StackPanel>
+                                <TextBlock Text="{Binding ProductSaledLastYear, StringFormat='{}{0} продаж за год', FallbackValue='Продажи не найдены'}"/>
+                                <TextBlock Text="{Binding Phone}"/>
+                                <TextBlock Text="{Binding Priority, StringFormat='Приоритетность: {0}'}"/>
+                            </StackPanel>
+                            <TextBlock Grid.Column="2"
+                                       Text="{Binding Discount, StringFormat='{}{0} %', FallbackValue='Скидка не найдена'}"
+                                       FontSize="24"
+                                       HorizontalAlignment="Right"/>
                         </Grid>
                     </DataTemplate>
                 </ListBox.ItemTemplate>
             </ListBox>
         </Grid>
-        
-        <Grid Grid.Row="2">
 
+        <Grid Grid.Row="2"
+              Margin="5">
+            <StackPanel Orientation="Horizontal">
+                <Button Content="Назад"/>
+                <TextBlock Text="{Binding CurrentPage, StringFormat='  {0} из', FallbackValue='  {0} из'}"/>
+                <TextBlock  Text="{Binding ItemsSource.Count, ElementName=ListBox, StringFormat=' {}{0}', FallbackValue=' {0}  '}"/>
+                <Button Content="Вперед"/>
+            </StackPanel>
         </Grid>
-
     </Grid>
 </Window>

BIN
WPF.Framework/Resources/no_picture.png


+ 1 - 0
WPF.Framework/WPF.Framework.csproj

@@ -322,6 +322,7 @@
       <DependentUpon>DatabaseModel.edmx</DependentUpon>
       <LastGenOutput>DatabaseModel.cs</LastGenOutput>
     </Content>
+    <Resource Include="Resources\no_picture.png" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>