zaaReloaded2/zaaReloaded2/Views/ElementPickerView.xaml
2015-09-09 21:45:55 +02:00

54 lines
2.5 KiB
XML
Executable File

<!--
ElementPickerView.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.ElementPickerView"
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"
Width="280" Height="320" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
WindowStyle="ToolWindow" Topmost="True"
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
Title="Neues Element auswählen"
FocusManager.FocusedElement="{Binding ElementName=treeview}"
>
<Window.Resources>
<ResourceDictionary Source="/Bovender;component/Style.xaml" />
</Window.Resources>
<DockPanel Margin="10">
<Label DockPanel.Dock="Top" Content="Verfügbare Elemente:" Target="{Binding ElementName=ElementsTreeView}" />
<UniformGrid DockPanel.Dock="Bottom" HorizontalAlignment="Right" Columns="2" Rows="1" Margin="0 10 0 0">
<Button Content="OK" Command="{Binding ChooseElementCommand}" IsDefault="True" Margin="0 0 5 0" />
<Button Content="Abbrechen" Command="{Binding CloseViewCommand}" IsCancel="True" Margin="5 0 0 0" />
</UniformGrid>
<TreeView ItemsSource="{Binding Categories}" x:Name="treeview">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="True" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayString}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</DockPanel>
</Window>