<UserControl x:Class="CBR.Views.OptionsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:Converters="clr-namespace:CBR.Components.Converters">
<Grid Margin="15" HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.ColumnSpan="5">
<TextBlock Style="{StaticResource TitleLabel}" Margin="5">Application Settings</TextBlock>
<Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="10">
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Images</TextBlock>
<Label Margin="5" HorizontalAlignment="Stretch">Number of images in cache</Label>
<DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch" Content="{Binding ElementName=sliderImageCache, Path=Value}"/>
<Slider Margin="15,0,15,0" Name="sliderImageCache" VerticalAlignment="Center" Value="{Binding ImageCacheCount}"
SmallChange="1" LargeChange="1" Maximum="10" TickPlacement="Both" TickFrequency="1" IsSnapToTickEnabled="True" AutoToolTipPlacement="None"
ToolTip="From 0 to 10, How long the images stays in memory from his last acces"/>
</DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch">Image duration (sec. after expiration) </Label>
<DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch" Content="{Binding ElementName=sliderDurationCache, Path=Value}"/>
<Slider Margin="15,0,15,0" Name="sliderDurationCache" VerticalAlignment="Center" Value="{Binding ImageCacheDuration}"
SmallChange="1" LargeChange="1" Maximum="10" TickPlacement="Both" TickFrequency="1" IsSnapToTickEnabled="True" AutoToolTipPlacement="None" ToolTip="From 0 to 10, How long the images stays in memory from his last acces"/>
</DockPanel>
<Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Auto fit mode</TextBlock>
<RadioButton GroupName="AutoFit" Margin="5" Name="rbNone"
IsChecked="{Binding Path=AutoFitMode, Converter={x:Static Converters:IntToRadioConverter.Instance}, ConverterParameter=0}">None : the images are displayed with the zoom factor</RadioButton>
<RadioButton GroupName="AutoFit" Margin="5" Name="rbWidth"
IsChecked="{Binding Path=AutoFitMode, Converter={x:Static Converters:IntToRadioConverter.Instance}, ConverterParameter=1}">Width : each time an image is displayed, it is adjusted to fill in width</RadioButton>
<RadioButton GroupName="AutoFit" Margin="5" Name="rbHeight"
IsChecked="{Binding Path=AutoFitMode, Converter={x:Static Converters:IntToRadioConverter.Instance}, ConverterParameter=2}">Height : each time an image is displayed, it is adjusted to fill in height</RadioButton>
<Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Magnifier</TextBlock>
<Label Margin="5" HorizontalAlignment="Stretch">Size of the magnifier</Label>
<DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch" Content="{Binding ElementName=sliderMagnifierSize, Path=Value}"/>
<Slider Margin="15,0,15,0" Name="sliderMagnifierSize" VerticalAlignment="Center" Value="{Binding MagnifierSize}"
SmallChange="0.1" LargeChange="0.1" Minimum="0.5" Maximum="2" TickPlacement="Both" TickFrequency="0.1" IsSnapToTickEnabled="True" AutoToolTipPlacement="None"
ToolTip="The size of the magnifier, related to his original size" />
</DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch">Scaling factor</Label>
<DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch" Content="{Binding ElementName=sliderMagnifierScale, Path=Value}"/>
<Slider Margin="15,0,15,0" Name="sliderMagnifierScale" VerticalAlignment="Center" Value="{Binding MagnifierScaleFactor}"
SmallChange="10" LargeChange="10" Minimum="100" Maximum="300" TickPlacement="Both" TickFrequency="10" IsSnapToTickEnabled="True" AutoToolTipPlacement="None"
ToolTip="How much pixel (from the original image) in the magnifier view "/>
</DockPanel>
</StackPanel>
<Line Grid.Column="1" Grid.Row="1" X1="0" Y2="1" Style="{StaticResource VerticalSeparator}" />
<StackPanel Grid.Column="2" Grid.Row="1" Orientation="Vertical" Margin="10">
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Recent files</TextBlock>
<Label Margin="5" HorizontalAlignment="Stretch">Number of recent book or library in the recent file list</Label>
<DockPanel>
<Label Margin="5" HorizontalAlignment="Stretch" Content="{Binding ElementName=sliderRecentFileMax, Path=Value}"/>
<Slider Margin="15,0,15,0" Name="sliderRecentFileMax" VerticalAlignment="Center" Value="{Binding MaxRecentFile}"
SmallChange="2" LargeChange="1" Maximum="20" TickPlacement="Both" TickFrequency="2" IsSnapToTickEnabled="True" AutoToolTipPlacement="None"
Minimum="5" ToolTip="From 0 to 50, how long the files stays in list from his last acces"/>
</DockPanel>
<Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Dynamic properties</TextBlock>
<Label Margin="5" HorizontalAlignment="Stretch">Existing properties</Label>
<StackPanel Margin="5">
<ListBox ItemsSource="{Binding Dynamics}" Name="lbProperties" />
<Button Margin="30,10,30,10" ToolTip="Delete an existing property and save the settings automatically" Content="Delete..."
Command="{Binding DeletePropertyCommand}" CommandParameter="{Binding ElementName=lbProperties, Path=SelectedValue}" />
</StackPanel>
<TextBlock Style="{StaticResource SubTitleLabel}" Margin="5">Add new property</TextBlock>
<StackPanel>
<Label Margin="5" HorizontalAlignment="Stretch">Property name</Label>
<TextBox Margin="30,0,30,0" ToolTip="Type the new property name here" Name="tbProperty"></TextBox>
<Button Margin="30,10,30,10" ToolTip="Add a new property and save the settings automatically" Content="Add..."
Command="{Binding AddPropertyCommand}" CommandParameter="{Binding ElementName=tbProperty, Path=Text}" />
</StackPanel>
<Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
</StackPanel>
<Line Grid.Column="3" Grid.Row="1" X1="0" Y2="1" Style="{StaticResource VerticalSeparator}" />
<StackPanel Grid.Row="1" Grid.Column="5" Orientation="Vertical" Margin="10" >
<Button Width="80" Height="80" Margin="10" ToolTip="Save the settings" Content="Save" Command="{Binding SaveSettingsCommand}" />
<Button Width="80" Height="80" Margin="10" ToolTip="Reset to default settings" Content="Reset" Command="{Binding ResetSettingsCommand}" />
</StackPanel>
</Grid>
</UserControl>