DB integration added, multiple images for equipment
This commit is contained in:
@@ -34,29 +34,38 @@
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="8"
|
||||
Text="{Binding Description}"/>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="2" Margin="2"
|
||||
ColumnDefinitions="*,20,8,20,8" RowDefinitions="8,20,*"
|
||||
IsVisible="True">
|
||||
<Image Stretch="Uniform" Grid.RowSpan="3" Grid.ColumnSpan="3"
|
||||
Source="{Binding Image.FileName, FallbackValue=null}"/>
|
||||
<Button Grid.Row="1" Grid.Column="1" Width="20" Height="20"
|
||||
IsVisible="{Binding IsImageSelected}"
|
||||
Command="{Binding AddImageCommand}"
|
||||
CommandParameter="{Binding #Window}">
|
||||
<Image Width="16" Height="16" Source="avares://GazpromApp/Assets/ic_fluent_edit_24_filled (Custom) 16.png"/>
|
||||
</Button>
|
||||
<Button Grid.Row="1" Grid.Column="3" Width="20" Height="20"
|
||||
IsVisible="{Binding IsImageSelected}"
|
||||
Command="{Binding DeleteImageCommand}">
|
||||
<Image Width="16" Height="16" Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom) 16.png"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Button Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center"
|
||||
IsVisible="{Binding !IsImageSelected}"
|
||||
Command="{Binding AddImageCommand}"
|
||||
CommandParameter="{Binding #Window}">
|
||||
<Image Width="24" Source="avares://GazpromApp/Assets/ic_fluent_camera_add_24_filled (Custom).png"/>
|
||||
</Button>
|
||||
<Panel Grid.Column="1" Grid.Row="2" Margin="8" IsVisible="{Binding !IsImagesEmpty}">
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<ItemsRepeater ItemsSource="{Binding Images}" HorizontalAlignment="Center">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout Orientation="Horizontal" MaximumRowsOrColumns="1"/>
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate DataType="vm:ImageViewModel">
|
||||
<Border Margin="4" CornerRadius="4" Background="LightGray">
|
||||
<Grid Margin="2" Width="200" Height="200" Background="LightGray"
|
||||
ColumnDefinitions="*,20,8" RowDefinitions="8,20,*">
|
||||
<Image Stretch="Uniform" Width="200" Height="200" Grid.RowSpan="3" Grid.ColumnSpan="3"
|
||||
Source="{Binding FileName}" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Width="20" Height="20"
|
||||
Command="{Binding #Root.((vm:NewEquipmentDialogViewModel)DataContext).DeleteImageCommand}"
|
||||
CommandParameter="{Binding .}">
|
||||
<Image Width="16" Height="16" Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom) 16.png"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
<Button HorizontalAlignment="Center" IsVisible="True"
|
||||
Command="{Binding AddImageCommand}"
|
||||
CommandParameter="{Binding #Window}">
|
||||
<Image Width="24" Source="avares://GazpromApp/Assets/ic_fluent_camera_add_24_filled (Custom).png"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Panel>
|
||||
|
||||
<Button Grid.Column="0" Grid.Row="3" Margin="8" Content="Отменить"
|
||||
Command="{Binding CancelEnterEquipmentCommand}"
|
||||
|
||||
Reference in New Issue
Block a user