zaaReloaded2/zaaReloaded2/Views/SettingsRepositoryView.xaml
2015-08-13 17:59:23 +02:00

114 lines
6.8 KiB
XML
Executable File

<!--
AboutView - Copy.xaml
part of zaaReloaded2
Copyright 2015 Daniel Kraus
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Window x:Class="zaaReloaded2.Views.SettingsRepositoryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:action="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
Width="340" Height="370" Topmost="True"
MinWidth="370" MinHeight="380" WindowStyle="ToolWindow"
ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
Title="Stil auswählen"
>
<Window.Resources>
<ResourceDictionary Source="/zaaReloaded2;component/style.xaml" />
</Window.Resources>
<i:Interaction.Triggers>
<i:EventTrigger SourceObject="{Binding EditSettingsMessage}" EventName="Sent">
<action:ShowViewAction View="zaaReloaded2.Views.SettingsView" Assembly="zaaReloaded2" />
</i:EventTrigger>
<i:EventTrigger SourceObject="{Binding ConfirmDeleteSettingsMessage}" EventName="Sent">
<action:ConfirmationAction Caption="Stil entfernen" OkButtonLabel="Ja" CancelButtonLabel="Nein"
Message="Soll dieser Stil wirklich unwiederbringlich entfernt werden?" />
</i:EventTrigger>
<i:EventTrigger SourceObject="{Binding ConfirmResetSettingsMessage}" EventName="Sent">
<action:ConfirmationAction Caption="Stile zurücksetzen" OkButtonLabel="Ja" CancelButtonLabel="Nein"
Message="Sollen alle Stile gelöscht und die eingebauten Stile geladen werden?" />
</i:EventTrigger>
<i:EventTrigger SourceObject="{Binding ChooseExportFileNameMessage}" EventName="Sent">
<action:ChooseFileSaveAction Caption="Stil exportieren" Message="Bitte Dateinamen für den Export angeben." />
</i:EventTrigger>
<i:EventTrigger SourceObject="{Binding ChooseImportFileNameMessage}" EventName="Sent">
<action:ChooseFileOpenAction Caption="Stil importieren" Message="Bitte zu importierende Datei auswählen." />
</i:EventTrigger>
<!-- TODO: Implement meaningful error messages. -->
<i:EventTrigger SourceObject="{Binding ExportErrorMessage}" EventName="Sent">
<action:ShowViewDialogAction Assembly="zaaReloaded2" View="zaaReloaded2.Views.IoErrorView" />
</i:EventTrigger>
<i:EventTrigger SourceObject="{Binding ImportErrorMessage}" EventName="Sent">
<action:ShowViewDialogAction Assembly="zaaReloaded2" View="zaaReloaded2.Views.IoErrorView" />
</i:EventTrigger>
</i:Interaction.Triggers>
<DockPanel Margin="10">
<Label DockPanel.Dock="Top" Target="{Binding ElementName=settingsList}">Bitte Stil auswählen:</Label>
<StackPanel DockPanel.Dock="Right" Margin="10 0 0 0">
<Button Command="{Binding UseSettingsCommand}" IsDefault="True" x:Name="OkButton"
ToolTip="Stil auswählen und Textblock damit formatieren (Enter)">
<StackPanel Orientation="Horizontal">
<Image Source="/zaaReloaded2;component/Icons/f.png" Width="32" />
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Auswählen</TextBlock>
</StackPanel>
</Button>
<UniformGrid Columns="2" Margin="0 10 0 0" x:Name="buttonsPanel">
<Button Command="{Binding AddSettingsCommand}" ToolTip="Hinzufügen" Margin="0 0 5 5">
<Image Source="/zaaReloaded2;component/Icons/plus.png" Width="24" />
</Button>
<Button Command="{Binding DeleteSettingsCommand}" ToolTip="Entfernen" Margin="5 0 0 5">
<Image Source="/zaaReloaded2;component/Icons/minus.png" Width="24" />
</Button>
<Button Command="{Binding EditSettingsCommand}" ToolTip="Bearbeiten (Leertaste)" Margin="0 5 5 5">
<Image Source="/zaaReloaded2;component/Icons/pen.png" Width="24" />
</Button>
<Button Command="{Binding CopySettingsCommand}" ToolTip="Kopieren (STRG+D)" Margin="5 5 0 5">
<Image Source="/zaaReloaded2;component/Icons/duplicate.png" Width="24" />
</Button>
<Button Command="{Binding ExportSettingsCommand}" ToolTip="Exportieren (STRG+S)" Margin="0 5 5 5">
<Image Source="/zaaReloaded2;component/Icons/export.png" Width="24" />
</Button>
<Button Command="{Binding ImportSettingsCommand}" ToolTip="Importieren (STRG+O)" Margin="5 5 0 5">
<Image Source="/zaaReloaded2;component/Icons/import.png" Width="24" />
</Button>
<Button Command="{Binding ResetSettingsCommand}" ToolTip="Auf Werkseinstellungen zurücksetzen"
Margin="0 5 5 5">
<Image Source="/zaaReloaded2;component/Icons/reset.png" Width="24" />
</Button>
<Button Command="{Binding CloseViewCommand}" ToolTip="Schließen" Margin="5 5 0 5">
<Image Source="/zaaReloaded2;component/Icons/exit.png" Width="24" />
</Button>
</UniformGrid>
</StackPanel>
<ListBox ItemsSource="{Binding SettingsList}"
DisplayMemberPath="Name"
ItemContainerStyle="{DynamicResource ResourceKey=ViewModelListBox}"
x:Name="settingsList">
<ListBox.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding UseSettingsCommand}" />
<KeyBinding Key="Space" Command="{Binding EditSettingsCommand}" />
<KeyBinding Key="Delete" Command="{Binding DeleteSettingsCommand}" />
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ExportSettingsCommand}" />
<KeyBinding Key="O" Modifiers="Control" Command="{Binding ImportSettingsCommand}" />
<KeyBinding Key="D" Modifiers="Control" Command="{Binding CopySettingsCommand}" />
</ListBox.InputBindings>
</ListBox>
</DockPanel>
</Window>