123 lines
6.2 KiB
XML
123 lines
6.2 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d"
|
|
d:DesignWidth="800"
|
|
d:DesignHeight="450"
|
|
x:Class="MayShow.Views.SettingsView"
|
|
xmlns:models="clr-namespace:MayShow.Models"
|
|
xmlns:enums="clr-namespace:MayShow.Enums"
|
|
xmlns:vm="clr-namespace:MayShow.ViewModels"
|
|
xmlns:converters="using:Avalonia.Controls.Converters"
|
|
x:DataType="vm:SettingsViewModel"
|
|
MaxWidth="450">
|
|
<UserControl.Resources>
|
|
<converters:EnumToBoolConverter x:Key="EnumToBoolConverter" />
|
|
</UserControl.Resources>
|
|
<ScrollViewer AllowAutoHide="False">
|
|
<StackPanel Orientation="Vertical"
|
|
Spacing="8"
|
|
Margin="12,4,12,4">
|
|
<Label Content="Settings"
|
|
HorizontalAlignment="Center"
|
|
FontSize="16"
|
|
FontWeight="Bold" />
|
|
<TextBlock TextWrapping="Wrap"
|
|
HorizontalAlignment="Left"
|
|
Width="350">
|
|
Always reduce size of images if above this file size in megabytes (MB):
|
|
</TextBlock>
|
|
<NumericUpDown Value="{Binding ImageResizeThreshold}"
|
|
Increment="0.1"
|
|
Minimum="0.5"
|
|
FormatString="0.00"
|
|
Maximum="10"
|
|
Width="150"
|
|
HorizontalAlignment="Left"
|
|
Margin="0,0,0,4" />
|
|
<CheckBox IsChecked="{Binding !UseDocnetPDFImageRendering}">Use legacy PDF handling (does not work with macOS annotations)</CheckBox>
|
|
<StackPanel Spacing="0">
|
|
<Label HorizontalAlignment="Left">
|
|
Save created PDF Report in the following location:
|
|
</Label>
|
|
<RadioButton Content="MayShow application directory"
|
|
IsChecked="{Binding PDFOutputSaveLocation,
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
ConverterParameter={x:Static enums:PDFSaveLocation.BaseFolder}}" />
|
|
<RadioButton Content="Ask me where to save the PDF file every time"
|
|
IsChecked="{Binding PDFOutputSaveLocation,
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
ConverterParameter={x:Static enums:PDFSaveLocation.AlwaysAsk}}" />
|
|
<RadioButton Content="Always save PDF file in the same folder of my choice"
|
|
IsChecked="{Binding PDFOutputSaveLocation,
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
ConverterParameter={x:Static enums:PDFSaveLocation.OtherChosenDir}}" />
|
|
</StackPanel>
|
|
<Grid ColumnDefinitions="Auto, *"
|
|
IsVisible="{Binding SaveOutputPdfInChosenDir}">
|
|
<Button Content="Choose PDF report output folder..."
|
|
Grid.Column="0"
|
|
Command="{Binding ChooseOutputFolder}"
|
|
VerticalAlignment="Top"/>
|
|
<TextBlock Text="{Binding OutputPdfDirPath}"
|
|
Margin="4,0,0,0"
|
|
TextWrapping="Wrap"
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"/>
|
|
</Grid>
|
|
<Label Content="File List Date Format"
|
|
HorizontalAlignment="Left"
|
|
FontSize="14" />
|
|
<ComboBox SelectedIndex="{Binding DataGridDisplayDateFormatSelectedIndex}"
|
|
ItemsSource="{Binding DateFormats}"
|
|
MaxDropDownHeight="300">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="models:DateDisplayFormat">
|
|
<TextBlock Text="{Binding Example}"
|
|
TextWrapping="Wrap"/>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
<Label Content="PDF Report Date Format"
|
|
HorizontalAlignment="Left"
|
|
FontSize="14" />
|
|
<ComboBox SelectedIndex="{Binding ReportDisplayDateFormatSelectedIndex}"
|
|
ItemsSource="{Binding DateFormats}"
|
|
MaxDropDownHeight="300">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="models:DateDisplayFormat">
|
|
<TextBlock Text="{Binding Example}"
|
|
TextWrapping="Wrap"/>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
<Button Command="{Binding OpenSettingsDir}">
|
|
<TextBlock>
|
|
<Run Text=""
|
|
FontFamily="{StaticResource FontAwesomeSolid}" /> Open MayShow Settings Directory</TextBlock>
|
|
</Button>
|
|
<TextBlock TextWrapping="Wrap"
|
|
Foreground="Red"
|
|
Text="{Binding ErrorMessage}"
|
|
IsVisible="{Binding HasErrorMessage}"/>
|
|
<StackPanel Orientation="Horizontal"
|
|
Spacing="12"
|
|
Margin="0,4,0,0"
|
|
HorizontalAlignment="Right">
|
|
<Button Command="{Binding Cancel}">
|
|
<TextBlock>
|
|
<Run Text=""
|
|
FontFamily="{StaticResource FontAwesomeSolid}" /> Cancel</TextBlock>
|
|
</Button>
|
|
<Button Command="{Binding Save}"
|
|
Classes="accent">
|
|
<TextBlock>
|
|
<Run Text=""
|
|
FontFamily="{StaticResource FontAwesomeSolid}" /> Save</TextBlock>
|
|
</Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl> |