forked from amkovkov/GranuSightSoftware2
1340 lines
72 KiB
XML
1340 lines
72 KiB
XML
<UserControl
|
|
x:Class="GSS2.Views.AmineContent.AnalysisView"
|
|
x:DataType="vm:AnalysisViewModel"
|
|
xmlns:controls="using:GSS2.Controls"
|
|
xmlns:core="using:GSS2.UI.Core"
|
|
xmlns:i="using:Avalonia.Xaml.Interactivity"
|
|
xmlns:ia="using:Avalonia.Xaml.Interactions.Custom"
|
|
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:GSS2.ViewModels.AmineContent"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns="https://github.com/avaloniaui"
|
|
>
|
|
|
|
<Grid Background="{StaticResource MainBackground}">
|
|
|
|
<!-- Основная форма -->
|
|
<Grid IsEnabled="{Binding CanInteract}" ColumnSpacing="5" RowSpacing="5">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" /> <!-- Кнопка "Удалить" -->
|
|
<ColumnDefinition Width="*" /> <!-- Кнопка "Сохранить" -->
|
|
<ColumnDefinition Width="*" /> <!-- К информации/К изображению -->
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" /> <!-- Главная панель -->
|
|
<RowDefinition Height="Auto" /> <!-- Кнопки главной панели -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- Главная панель -->
|
|
<core:SectionPanel
|
|
CanScrollBackward="{Binding MainSectionCanScrollBackward}"
|
|
CanScrollForward="{Binding MainSectionCanScrollForward}"
|
|
ClipToBounds="True"
|
|
CurrentIndex="{Binding MainSectionCurrentIndex}"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="3"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
IsScrolling="{Binding MainSectionIsScrolling}"
|
|
Orientation="Vertical"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
|
|
<!-- Информация -->
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" /> <!-- Кнопка меню -->
|
|
<ColumnDefinition Width="*" /> <!-- Информация -->
|
|
<ColumnDefinition Width="*" /> <!-- Информация -->
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" /> <!-- Информация -->
|
|
<RowDefinition Height="Auto" /> <!-- Кнопки -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- Кнопка меню -->
|
|
<Button
|
|
Classes="vertical"
|
|
Command="{Binding ToggleMenuCommand}"
|
|
Grid.Column="0"
|
|
Grid.Row="0"
|
|
Grid.RowSpan="3"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="☰"/>
|
|
</Button>
|
|
|
|
<!-- Информация -->
|
|
<core:SectionPanel
|
|
CanScrollBackward="{Binding InfoSectionCanScrollBackward}"
|
|
CanScrollForward="{Binding InfoSectionCanScrollForward}"
|
|
ClipToBounds="True"
|
|
CurrentIndex="{Binding InfoSectionCurrentIndex}"
|
|
Cyclic="True"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="2"
|
|
Grid.Row="0"
|
|
IsScrolling="{Binding InfoSectionIsScrolling}"
|
|
Orientation="Horizontal"
|
|
>
|
|
|
|
<!-- Id / Uuid / SampleName / BrandComboBox / SamplingDateTime / SamplingPlace -->
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" /> <!-- Id (подпись) | Uuid (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- Id (поле ) | Uuid (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- SeparatorComboBox (подпись) | BrandComboBox (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- SeparatorComboBox (поле ) | BrandComboBox (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- SampleName (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- SampleName (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- SamplingDateTime (подпись) | SamplingPlace (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- SamplingDateTime (поле ) | SamplingPlace (поле ) -->
|
|
<RowDefinition Height="*" /> <!-- Пустое пространство -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- Id (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="0"
|
|
Text="ИД:"
|
|
/>
|
|
<!-- Id (поле) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="1"
|
|
IsReadOnly="True"
|
|
PlaceholderText="ИД"
|
|
Text="{Binding Record.Id}"
|
|
/>
|
|
<!-- Uuid (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="0"
|
|
Text="Уникальный ИД:"
|
|
/>
|
|
<!-- Uuid (поле) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Уникальный ИД"
|
|
Text="{Binding Record.Uuid}"
|
|
/>
|
|
<!-- SeparatorComboBox (подпись) -->
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
Classes="mini"
|
|
Text="Тип сепаратора:"
|
|
/>
|
|
<!-- SeparatorComboBox (поле) -->
|
|
<ComboBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="3"
|
|
HorizontalAlignment="Stretch"
|
|
IsEditable="False"
|
|
IsEnabled="{Binding CanInteract}"
|
|
IsVisible="{Binding IsNewRecord}"
|
|
ItemsSource="{Binding SeparatorComboBoxItems}"
|
|
PlaceholderText="Тип сепаратора"
|
|
SelectedIndex="{Binding SeparatorComboBoxSelectedIndex}"
|
|
>
|
|
|
|
<ComboBox.Styles>
|
|
|
|
<Style Selector="ComboBox /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
<Style Selector="ComboBoxItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
</ComboBox.Styles>
|
|
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:AnalysisViewModel+SeparatorComboBoxItemViewModel">
|
|
<TextBlock>
|
|
<Run Text="{Binding Id, StringFormat='[{0}] '}" />
|
|
<Run Text="{Binding Type}" />
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="3"
|
|
IsReadOnly="True"
|
|
IsVisible="{Binding !IsNewRecord}"
|
|
PlaceholderText="Тип сепаратора"
|
|
Text="{Binding Record.SeparatorType}"
|
|
/>
|
|
<!-- BrandComboBox (подпись) -->
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
Classes="mini"
|
|
Text="Марка пробы:"
|
|
/>
|
|
<!-- BrandComboBox (поле) -->
|
|
<ComboBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="3"
|
|
HorizontalAlignment="Stretch"
|
|
IsEditable="False"
|
|
IsEnabled="{Binding CanInteract}"
|
|
IsVisible="{Binding IsNewRecord}"
|
|
ItemsSource="{Binding BrandComboBoxItems}"
|
|
PlaceholderText="Марка пробы"
|
|
SelectedIndex="{Binding BrandComboBoxSelectedIndex}"
|
|
>
|
|
|
|
<ComboBox.Styles>
|
|
|
|
<Style Selector="ComboBox /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
<Style Selector="ComboBoxItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
</ComboBox.Styles>
|
|
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:AnalysisViewModel+BrandComboBoxItemViewModel">
|
|
<TextBlock>
|
|
<Run Text="{Binding Id, StringFormat='[{0}] '}" />
|
|
<Run Text="{Binding BrandName}" />
|
|
<Run Text=" - " />
|
|
<Run Text="{Binding MixtureName}" />
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="3"
|
|
IsReadOnly="True"
|
|
IsVisible="{Binding !IsNewRecord}"
|
|
PlaceholderText="Марка пробы"
|
|
>
|
|
<TextBox.Text>
|
|
<MultiBinding StringFormat="{}{0} - {1} ({2} кг/т)" Mode="OneWay">
|
|
<Binding Path="Record.BrandName" />
|
|
<Binding Path="Record.MixtureName" />
|
|
<Binding Path="Record.MixtureNormalRate" />
|
|
</MultiBinding>
|
|
</TextBox.Text>
|
|
</TextBox>
|
|
|
|
<!-- SampleName (подпись) -->
|
|
<TextBlock
|
|
Grid.Row="4"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Classes="mini"
|
|
Text="Название пробы:"
|
|
/>
|
|
<!-- SampleName (поле) -->
|
|
<controls:TouchTextBox
|
|
Grid.Row="5"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Classes="singleline"
|
|
Text="{Binding Record.SampleName}"
|
|
PlaceholderText="Название пробы"
|
|
/>
|
|
<!-- SamplingDateTime (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="6"
|
|
Text="Дата и время отбора пробы:"
|
|
/>
|
|
<!-- SamplingDateTime (поле) -->
|
|
<controls:TouchTextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="7"
|
|
PlaceholderText="Дата и время отбора пробы"
|
|
Text="{Binding Record.SamplingDateTime, Converter={StaticResource DateTimeConverter}}"
|
|
/>
|
|
<!-- SamplingPlace (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="6"
|
|
Text="Место отбора пробы:"
|
|
/>
|
|
<!-- SamplingPlace (поле) -->
|
|
<controls:TouchTextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="7"
|
|
PlaceholderText="Место отбора пробы"
|
|
Text="{Binding Record.SamplingPlace}"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- SampleComment -->
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" /> <!-- SampleComment (подпись) -->
|
|
<RowDefinition Height="*" /> <!-- SampleComment (поле ) -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- SampleComment (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Row="0"
|
|
Text="Дополнительная информация о пробе:"
|
|
/>
|
|
<!-- SampleComment (поле) -->
|
|
<controls:TouchTextBox
|
|
Classes="multiline"
|
|
Grid.Row="1"
|
|
PlaceholderText="Дополнительная информация о пробе"
|
|
Text="{Binding Record.SampleComment}"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Изображения -->
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/> <!-- Изображения -->
|
|
<ColumnDefinition Width="Auto"/> <!-- Кнопки -->
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- Кнопки переключения -->
|
|
<!-- Image -->
|
|
<Button
|
|
Classes="vertical"
|
|
Command="{Binding SwitchToImageCommand}"
|
|
Grid.Column="1"
|
|
Grid.Row="0"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="1"/>
|
|
</Button>
|
|
|
|
<!-- MaskImage -->
|
|
<Button
|
|
Classes="vertical"
|
|
Command="{Binding SwitchToMaskImageCommand}"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="2"/>
|
|
</Button>
|
|
|
|
<!-- ResultImage -->
|
|
<Button
|
|
Classes="vertical"
|
|
Command="{Binding SwitchToResultImageCommand}"
|
|
Grid.Column="1"
|
|
Grid.Row="2"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="3"/>
|
|
</Button>
|
|
|
|
<!-- Изображения -->
|
|
<Grid Grid.Column="0" Grid.Row="0" Grid.RowSpan="3">
|
|
|
|
<!-- Изображения -->
|
|
<!-- Image -->
|
|
<Grid IsVisible="{Binding ImageIsVisible}" IsEnabled="{Binding ImageIsVisible}">
|
|
|
|
<!-- Изображение -->
|
|
<core:ZoomPanImage
|
|
Background="Black"
|
|
HorizontalAlignment="Stretch"
|
|
ImageSource="{Binding Record.Image.Image}"
|
|
PanX="{Binding ImagesPanX, Mode=TwoWay}"
|
|
PanY="{Binding ImagesPanY, Mode=TwoWay}"
|
|
VerticalAlignment="Stretch"
|
|
Zoom="{Binding ImagesZoom, Mode=TwoWay}"
|
|
>
|
|
|
|
<core:ZoomPanImage.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}" Path="Record.Image.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</core:ZoomPanImage.IsVisible>
|
|
|
|
</core:ZoomPanImage>
|
|
|
|
<!-- Оверлей "Изображение загружается" -->
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" >
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="Изображение загружается" />
|
|
|
|
</StackPanel>
|
|
|
|
<!-- Оверлей "Изображение отсутствует" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
Text="Изображение отсутствует"
|
|
VerticalAlignment="Center"
|
|
>
|
|
<TextBlock.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</TextBlock.IsVisible>
|
|
</TextBlock>
|
|
|
|
<!-- Оверлей прогресс -->
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
>
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<!-- <Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" /> -->
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding ImagesCapturingProgress}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<!-- MaskImage -->
|
|
<Grid IsVisible="{Binding MaskImageIsVisible}" IsEnabled="{Binding MaskImageIsVisible}">
|
|
|
|
<!-- Изображение -->
|
|
<core:ZoomPanImage
|
|
Background="Black"
|
|
HorizontalAlignment="Stretch"
|
|
ImageSource="{Binding Record.MaskImage.Image}"
|
|
PanX="{Binding ImagesPanX, Mode=TwoWay}"
|
|
PanY="{Binding ImagesPanY, Mode=TwoWay}"
|
|
VerticalAlignment="Stretch"
|
|
Zoom="{Binding ImagesZoom, Mode=TwoWay}"
|
|
>
|
|
|
|
<core:ZoomPanImage.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}" Path="Record.MaskImage.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.MaskImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</core:ZoomPanImage.IsVisible>
|
|
|
|
</core:ZoomPanImage>
|
|
|
|
<!-- Оверлей "Изображение загружается" -->
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" >
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="Record.MaskImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="Изображение загружается" />
|
|
|
|
</StackPanel>
|
|
|
|
<!-- Оверлей "Изображение отсутствует" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
Text="Изображение отсутствует"
|
|
VerticalAlignment="Center"
|
|
>
|
|
<TextBlock.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.MaskImage.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.MaskImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</TextBlock.IsVisible>
|
|
</TextBlock>
|
|
|
|
<!-- Оверлей прогресс -->
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
>
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<!-- <Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.MaskImage.Data" /> -->
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.MaskImage.IsLoading" />
|
|
<Binding Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding ImagesCapturingProgress}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<!-- ResultImage -->
|
|
<Grid IsVisible="{Binding ResultImageIsVisible}" IsEnabled="{Binding ResultImageIsVisible}">
|
|
|
|
<!-- Изображение -->
|
|
<core:ZoomPanImage
|
|
Background="Black"
|
|
HorizontalAlignment="Stretch"
|
|
ImageSource="{Binding Record.ResultImage.Image}"
|
|
PanX="{Binding ImagesPanX, Mode=TwoWay}"
|
|
PanY="{Binding ImagesPanY, Mode=TwoWay}"
|
|
VerticalAlignment="Stretch"
|
|
Zoom="{Binding ImagesZoom, Mode=TwoWay}"
|
|
>
|
|
|
|
<core:ZoomPanImage.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}" Path="Record.ResultImage.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.ResultImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</core:ZoomPanImage.IsVisible>
|
|
|
|
</core:ZoomPanImage>
|
|
|
|
<!-- Оверлей "Изображение загружается" -->
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" >
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="Record.ResultImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="Изображение загружается" />
|
|
|
|
</StackPanel>
|
|
|
|
<!-- Оверлей "Изображение отсутствует" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
Text="Изображение отсутствует"
|
|
VerticalAlignment="Center"
|
|
>
|
|
<TextBlock.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.ResultImage.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.ResultImage.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</TextBlock.IsVisible>
|
|
</TextBlock>
|
|
|
|
<!-- Оверлей прогресс -->
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
>
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<!-- <Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.ResultImage.Data" /> -->
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.ResultImage.IsLoading" />
|
|
<Binding Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding ImagesCapturingProgress}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<!-- Общая информация -->
|
|
<Grid>
|
|
|
|
<Grid IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" /> <!-- ParticlesCount (подпись) | MeanProcessedArea (подпись) | ProcessedAreaP50 (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- ParticlesCount (поле ) | MeanProcessedArea (поле ) | ProcessedAreaP50 (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- ProcessedAreaP10 (подпись) | ProcessedAreaP90 (подпись) | ProcessedAreaDeltaP90P10 (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- ProcessedAreaP10 (поле ) | ProcessedAreaP90 (поле ) | ProcessedAreaDeltaP90P10 (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- ProcessedAreaStdDev (подпись) | InterHeterogeneity (подпись) | UnprocessedFraction (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- ProcessedAreaStdDev (поле ) | InterHeterogeneity (поле ) | UnprocessedFraction (поле ) -->
|
|
<RowDefinition Height="Auto" /> <!-- MeanInnerHeterogeneity (подпись) | MeanHotspotArea (подпись) | MeanOpticalIntegral (подпись) -->
|
|
<RowDefinition Height="Auto" /> <!-- MeanInnerHeterogeneity (поле ) | MeanHotspotArea (поле ) | MeanOpticalIntegral (поле ) -->
|
|
<RowDefinition Height="*" /> <!-- Пустое пространство -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- ParticlesCount (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="0"
|
|
Text="Количество гранул:"
|
|
/>
|
|
<!-- ParticlesCount (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="1"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Количество гранул"
|
|
Text="{Binding Record.ParticlesCount}"
|
|
/>
|
|
<!-- MeanProcessedArea (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="0"
|
|
Text="Ср. норм. обр. площадь:"
|
|
/>
|
|
<!-- MeanProcessedArea (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Средняя норм. обр. площадь"
|
|
Text="{Binding Record.MeanProcessedArea, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- ProcessedAreaP50 (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="2"
|
|
Grid.Row="0"
|
|
Text="50-й процентиль:"
|
|
/>
|
|
<!-- ProcessedAreaP50 (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
IsReadOnly="True"
|
|
PlaceholderText="XXX"
|
|
Text="{Binding Record.ProcessedAreaP50, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- ProcessedAreaP10 (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="2"
|
|
Text="10-й процентиль:"
|
|
/>
|
|
<!-- ProcessedAreaP10 (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="3"
|
|
IsReadOnly="True"
|
|
PlaceholderText="10-й процентиль"
|
|
Text="{Binding Record.ProcessedAreaP10, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- ProcessedAreaP90 (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="2"
|
|
Text="90-й процентиль:"
|
|
/>
|
|
<!-- ProcessedAreaP90 (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="3"
|
|
IsReadOnly="True"
|
|
PlaceholderText="90-й процентиль"
|
|
Text="{Binding Record.ProcessedAreaP90, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- ProcessedAreaDeltaP90P10 (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="2"
|
|
Grid.Row="2"
|
|
Text="Ширина центр. диапазона:"
|
|
/>
|
|
<!-- ProcessedAreaDeltaP90P10 (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="2"
|
|
Grid.Row="3"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Ширина центрального диапазона"
|
|
Text="{Binding Record.ProcessedAreaDeltaP90P10, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- ProcessedAreaStdDev (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="4"
|
|
Text="Межгр. СКО:"
|
|
/>
|
|
<!-- ProcessedAreaStdDev (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="5"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Межгранульное СКО"
|
|
Text="{Binding Record.ProcessedAreaStdDev, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- InterHeterogeneity (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="4"
|
|
Text="Межгр. неоднородность:"
|
|
/>
|
|
<!-- InterHeterogeneity (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="5"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Межгранульная неоднородность"
|
|
Text="{Binding Record.InterHeterogeneity, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- UnprocessedFraction (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="2"
|
|
Grid.Row="4"
|
|
Text="Доля необр. гранул:"
|
|
/>
|
|
<!-- UnprocessedFraction (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="2"
|
|
Grid.Row="5"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Доля необработанных гранул"
|
|
Text="{Binding Record.UnprocessedFraction, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- MeanInnerHeterogeneity (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="0"
|
|
Grid.Row="6"
|
|
Text="Ср. внутригр. однородность:"
|
|
/>
|
|
<!-- MeanInnerHeterogeneity (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="0"
|
|
Grid.Row="7"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Ср. внутригранульная однородность"
|
|
Text="{Binding Record.MeanInnerHeterogeneity, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- MeanHotspotArea (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="1"
|
|
Grid.Row="6"
|
|
Text="Ср. горячая площадь:"
|
|
/>
|
|
<!-- MeanHotspotArea (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="1"
|
|
Grid.Row="7"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Ср. горячая площадь"
|
|
Text="{Binding Record.MeanHotspotArea, StringFormat={}{0:F4}}"
|
|
/>
|
|
<!-- MeanOpticalIntegral (подпись) -->
|
|
<TextBlock
|
|
Classes="mini"
|
|
Grid.Column="2"
|
|
Grid.Row="6"
|
|
Text="Ср. инт. опт. показатель:"
|
|
/>
|
|
<!-- MeanOpticalIntegral (поле ) -->
|
|
<TextBox
|
|
Classes="singleline"
|
|
Grid.Column="2"
|
|
Grid.Row="7"
|
|
IsReadOnly="True"
|
|
PlaceholderText="Ср. инт. опт. показатель"
|
|
Text="{Binding Record.MeanOpticalIntegral, StringFormat={}{0:F4}}"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Гистограмма нормированных обработанных площадей -->
|
|
<Grid>
|
|
|
|
<!-- Гистограмма -->
|
|
<lvc:CartesianChart
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}"
|
|
Series="{Binding Record.ProcessedAreasHistogram.Series, Mode=OneWay}"
|
|
VerticalAlignment="Stretch"
|
|
x:Name="ProcessedAreasHistogram"
|
|
XAxes="{Binding Record.ProcessedAreasHistogram.XAxis, Mode=OneWay}"
|
|
YAxes="{Binding Record.ProcessedAreasHistogram.YAxis, Mode=OneWay}"
|
|
/>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Гистограмма нормированных площадей хотспотов -->
|
|
<Grid>
|
|
|
|
<!-- Гистограмма -->
|
|
<lvc:CartesianChart
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}"
|
|
Series="{Binding Record.HotspotAreasHistogram.Series, Mode=OneWay}"
|
|
VerticalAlignment="Stretch"
|
|
x:Name="HotspotAreasHistogram"
|
|
XAxes="{Binding Record.HotspotAreasHistogram.XAxis, Mode=OneWay}"
|
|
YAxes="{Binding Record.HotspotAreasHistogram.YAxis, Mode=OneWay}"
|
|
/>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Гистограмма интегральных оптических показателей -->
|
|
<Grid>
|
|
|
|
<!-- Гистограмма -->
|
|
<lvc:CartesianChart
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}"
|
|
Series="{Binding Record.OpticalIntegralsHistogram.Series, Mode=OneWay}"
|
|
VerticalAlignment="Stretch"
|
|
x:Name="OpticalIntegralsHistogram"
|
|
XAxes="{Binding Record.OpticalIntegralsHistogram.XAxis, Mode=OneWay}"
|
|
YAxes="{Binding Record.OpticalIntegralsHistogram.YAxis, Mode=OneWay}"
|
|
/>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Гистограмма внутригранульных среднеквадратичных отклонений -->
|
|
<Grid>
|
|
|
|
<!-- Гистограмма -->
|
|
<lvc:CartesianChart
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}"
|
|
Series="{Binding Record.InnerStdDevsHistogram.Series, Mode=OneWay}"
|
|
VerticalAlignment="Stretch"
|
|
x:Name="InnerStdDevsHistogram"
|
|
XAxes="{Binding Record.InnerStdDevsHistogram.XAxis, Mode=OneWay}"
|
|
YAxes="{Binding Record.InnerStdDevsHistogram.YAxis, Mode=OneWay}"
|
|
/>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
<!-- Гистограмма внутригранульных неоднородностей -->
|
|
<Grid>
|
|
|
|
<!-- Гистограмма -->
|
|
<lvc:CartesianChart
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}"
|
|
Series="{Binding Record.InnerHeterogeneitiesHistogram.Series, Mode=OneWay}"
|
|
VerticalAlignment="Stretch"
|
|
x:Name="InnerHeterogeneitiesHistogram"
|
|
XAxes="{Binding Record.InnerHeterogeneitiesHistogram.XAxis, Mode=OneWay}"
|
|
YAxes="{Binding Record.InnerHeterogeneitiesHistogram.YAxis, Mode=OneWay}"
|
|
/>
|
|
|
|
<!-- Оверлей "Нет информации" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding Path=Record.ParticlesCount, Converter={StaticResource LessThanOrEqualConverter}, ConverterParameter=0}"
|
|
Text="Нет информации"
|
|
VerticalAlignment="Center"
|
|
/>
|
|
|
|
</Grid>
|
|
|
|
</core:SectionPanel>
|
|
|
|
<!-- Кнопка влево -->
|
|
<Button
|
|
Command="{Binding InfoSectionPreviousCommand}"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
>
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="InfoSectionCanScrollBackward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="InfoSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
<TextBlock Text="◀"/>
|
|
|
|
</Button>
|
|
|
|
<!-- Кнопка вправо -->
|
|
<Button
|
|
Command="{Binding InfoSectionNextCommand}"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
>
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="InfoSectionCanScrollForward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="InfoSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
<TextBlock Text="▶"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
<!-- Изображение -->
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" /> <!-- Изображение -->
|
|
<RowDefinition Height="Auto" /> <!-- Кнопка "Получить изображения" / "Отменить съёмку" -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>5</Grid.RowSpacing>
|
|
|
|
<!-- Изображение -->
|
|
<Grid>
|
|
|
|
<!-- Изображение -->
|
|
<core:ZoomPanImage
|
|
Background="Black"
|
|
HorizontalAlignment="Stretch"
|
|
ImageSource="{Binding Record.Image.Image}"
|
|
VerticalAlignment="Stretch"
|
|
>
|
|
|
|
<core:ZoomPanImage.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}" Path="Record.Image.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</core:ZoomPanImage.IsVisible>
|
|
|
|
</core:ZoomPanImage>
|
|
|
|
<!-- Оверлей "Изображение загружается" -->
|
|
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" >
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="Изображение загружается" />
|
|
|
|
</StackPanel>
|
|
|
|
<!-- Оверлей "Изображение отсутствует" -->
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
Text="Изображение отсутствует"
|
|
VerticalAlignment="Center"
|
|
>
|
|
<TextBlock.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</TextBlock.IsVisible>
|
|
</TextBlock>
|
|
|
|
<!-- Оверлей прогресс -->
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
>
|
|
|
|
<StackPanel.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<!-- <Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" /> -->
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
|
|
<Binding Path="ImagesIsCapturing" />
|
|
</MultiBinding>
|
|
</StackPanel.IsVisible>
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding ImagesCapturingProgress}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<!-- Кнопка "Получить изображения" -->
|
|
<Button
|
|
Command="{Binding CaptureImageCommand}"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
IsEnabled="{Binding CanCapture}"
|
|
IsVisible="{Binding !ImagesIsCapturing}"
|
|
>
|
|
<TextBlock Text="Получить изображения"/>
|
|
</Button>
|
|
|
|
<!-- Кнопка "Отменить съёмку" -->
|
|
<Button
|
|
Command="{Binding CancelImageCapturingCommand}"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding ImagesIsCapturing}"
|
|
>
|
|
<TextBlock Text="Отменить съёмку"/>
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</core:SectionPanel>
|
|
|
|
<!-- Кнопки главной панели -->
|
|
<!-- Кнопка "Удалить" -->
|
|
<Button
|
|
Classes="danger"
|
|
Command="{Binding DeleteRecordCommand}"
|
|
Grid.Column="0"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="Удалить"/>
|
|
</Button>
|
|
|
|
<!-- Кнопка "Сохранить" -->
|
|
<Button
|
|
Command="{Binding SaveRecordCommand}"
|
|
Content="Сохранить"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
>
|
|
<TextBlock Text="Сохранить"/>
|
|
</Button>
|
|
|
|
<!-- Кнопка "К информации" -->
|
|
<Button
|
|
Command="{Binding SwitchMainSectionCommand}"
|
|
Content="К информации"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding MainSectionCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=1}"
|
|
>
|
|
|
|
<TextBlock Text="К информации"/>
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="MainSectionCanScrollBackward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
<!-- Кнопка "К изображению" -->
|
|
<Button
|
|
Command="{Binding SwitchMainSectionCommand}"
|
|
Content="К изображению"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
IsVisible="{Binding MainSectionCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=0}"
|
|
>
|
|
|
|
<TextBlock Text="К изображению"/>
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="MainSectionCanScrollForward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
<!-- Полупрозрачный оверлей -->
|
|
<Border
|
|
Background="{StaticResource Overlay}"
|
|
IsEnabled="{Binding MenuOpened}"
|
|
IsVisible="{Binding MenuOpened}"
|
|
>
|
|
<Interaction.Behaviors>
|
|
<TappedTrigger>
|
|
<InvokeCommandAction Command="{Binding CloseMenuCommand}" />
|
|
</TappedTrigger>
|
|
</Interaction.Behaviors>
|
|
</Border>
|
|
|
|
<!-- Выезжающая боковая панель -->
|
|
<Border
|
|
Background="{StaticResource MenuBackground}"
|
|
BorderBrush="{StaticResource MenuBorder}"
|
|
BorderThickness="0,0,1,0"
|
|
HorizontalAlignment="Left"
|
|
IsEnabled="{Binding MenuOpened}"
|
|
IsVisible="{Binding MenuOpened}"
|
|
>
|
|
|
|
<!-- Переходы -->
|
|
<Border.Transitions>
|
|
<Transitions>
|
|
<TransformOperationsTransition Duration="0:0:0.25" Property="RenderTransform" />
|
|
</Transitions>
|
|
</Border.Transitions>
|
|
|
|
<!-- Поведения -->
|
|
<Interaction.Behaviors>
|
|
|
|
<!-- Поведение при открытии меню -->
|
|
<DataTriggerBehavior
|
|
Binding="{Binding MenuOpened}"
|
|
ComparisonCondition="Equal"
|
|
Value="True"
|
|
>
|
|
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(0px)" />
|
|
</DataTriggerBehavior>
|
|
|
|
<!-- Поведение при закрытии меню -->
|
|
<DataTriggerBehavior
|
|
Binding="{Binding MenuOpened}"
|
|
ComparisonCondition="Equal"
|
|
Value="False"
|
|
>
|
|
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(-320px)" />
|
|
</DataTriggerBehavior>
|
|
|
|
</Interaction.Behaviors>
|
|
|
|
<!-- Содержимое меню -->
|
|
<Grid Margin="10">
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/> <!-- Кнопка "Новая запись" -->
|
|
<RowDefinition Height="*"/> <!-- Элементы меню -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.RowSpacing>10</Grid.RowSpacing>
|
|
|
|
<!-- Кнопка "Новая запись" -->
|
|
<Button
|
|
Command="{Binding CreateRecordCommand}"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
MinWidth="200"
|
|
>
|
|
<TextBlock Text="Новая запись"/>
|
|
</Button>
|
|
|
|
<!-- Элементы меню -->
|
|
<ListBox
|
|
Background="{StaticResource MenuBackground}"
|
|
Grid.Row="1"
|
|
ItemsSource="{Binding MenuItems}"
|
|
SelectedIndex="{Binding MenuSelectedIndex}"
|
|
>
|
|
|
|
<!-- Шаблон списка элементов -->
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
|
|
<!-- Стили элементов -->
|
|
<ListBox.Styles>
|
|
|
|
<!-- Общий стиль -->
|
|
<Style Selector="ListBoxItem">
|
|
<Setter Property="Background" Value="{StaticResource ButtonBackground}" />
|
|
</Style>
|
|
|
|
<!-- Стиль выбранного элемента -->
|
|
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{StaticResource MainBackground}" />
|
|
</Style>
|
|
|
|
<!-- Стиль элемента над которым находится указатель -->
|
|
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{StaticResource MainBackground}" />
|
|
</Style>
|
|
|
|
</ListBox.Styles>
|
|
|
|
<!-- Шаблон элемента -->
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:AnalysisViewModel+MenuItemViewModel">
|
|
<Border Margin="3" CornerRadius="5">
|
|
<TextBlock
|
|
Classes="mini"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
>
|
|
<Run Text="{Binding Id, StringFormat='[{0}] '}" />
|
|
<Run Text="{Binding SampleName}" />
|
|
</TextBlock>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|