Imagara преди 3 години
родител
ревизия
8a13a5f552
променени са 2 файла, в които са добавени 47 реда и са изтрити 7 реда
  1. 39 3
      PartsWarehouse/PartInfoPage.xaml
  2. 8 4
      PartsWarehouse/PartInfoPage.xaml.cs

+ 39 - 3
PartsWarehouse/PartInfoPage.xaml

@@ -6,9 +6,45 @@
       xmlns:local="clr-namespace:PartsWarehouse"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="PartInfoPage">
+      Title="PartInfoPage"
+      Background="#32353B">
+
+    <Grid Background="#2F3136"
+          Margin="10">
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+
+        <Grid Grid.Row="0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="57*"/>
+                <ColumnDefinition Width="143*"/>
+            </Grid.ColumnDefinitions>
+
+            <Image Name="PartImage"
+                       Grid.Column="0"
+                       Margin="10"
+                       Source="/Resources/NotFound.png">
+            </Image>
+
+            <Grid Grid.Column="1"
+                  Margin="10"
+                  Background="#FF44464D">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="17*"/>
+                    <RowDefinition Height="22*"/>
+                </Grid.RowDefinitions>
+
+            </Grid>
+        </Grid>
+
+        <Grid Grid.Row="1">
+
+        </Grid>
+
+
+
 
-    <Grid>
-        
     </Grid>
 </Page>

+ 8 - 4
PartsWarehouse/PartInfoPage.xaml.cs

@@ -15,14 +15,18 @@ using System.Windows.Shapes;
 
 namespace PartsWarehouse
 {
-    /// <summary>
-    /// Логика взаимодействия для PartInfoPage.xaml
-    /// </summary>
     public partial class PartInfoPage : Page
     {
-        public PartInfoPage()
+        Parts part;
+        public PartInfoPage(int partId)
         {
             InitializeComponent();
+            part = cnt.db.Parts.Where(item => item.IdPart == partId).FirstOrDefault();
+            if (part.Image == null)
+                PartImage.Source = new BitmapImage(new Uri("../Resources/NotFound.png", UriKind.RelativeOrAbsolute));
+            else
+                PartImage.Source = ImagesManip.NewImage(part);
+
         }
     }
 }