zaaReloaded2/zaaReloaded2/Views/ElementPickerView.xaml

56 lines
2.6 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"
SizeToContent="WidthAndHeight" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
Title="Neues Element auswählen"
>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
<ResourceDictionary>
<DataTemplate x:Key="ChildElement">
<TextBlock Text="{Binding DisplayString}" />
</DataTemplate>
<HierarchicalDataTemplate x:Key="CategoriesTree"
ItemsSource="{Binding Children}"
ItemTemplate="{StaticResource ResourceKey=ChildElement}">
<TextBlock Text="{Binding DisplayString}" />
</HierarchicalDataTemplate>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Margin="10">
<Label Content="Verfügbare Elemente:" Target="{Binding ElementName=ElementsTreeView}" />
<!-- TODO: Expand tree by default. -->
<TreeView ItemsSource="{Binding Categories}" ItemTemplate="{StaticResource ResourceKey=CategoriesTree}"
Height="160" Width="240"/>
<UniformGrid HorizontalAlignment="Right" Columns="2" Rows="1" Margin="0 10 0 0">
<Button Content="OK" Command="{Binding ChooseElementCommand}" IsDefault="True" Margin="0 0 10 0" />
<Button Content="Abbrechen" Command="{Binding CloseViewCommand}" IsCancel="True" Margin="10 0 0 0" />
</UniformGrid>
</StackPanel>
</Window>