Files
BeWoPlaner/BeWo/View/Detail/SupportConceptGoalView.xaml
2020-08-17 15:50:00 +02:00

320 lines
20 KiB
XML

<localView:BeWoView
x:Class="BeWo.View.Detail.SupportConceptGoalView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:view="clr-namespace:BeWo.View.Detail"
xmlns:core="clr-namespace:BeWo.Core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:core1="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
<localView:BeWoView.Resources>
<ResourceDictionary>
<view:ValueListEntryTypeToFontWeightConverter x:Key="ValueListEntryTypeToFontWeightConverter" />
<view:ValueListEntryTypeToColorConverter x:Key="ValueListEntryTypeToColorConverter" />
<ContextMenu x:Key="cmGoals" MenuItem.Click="ContextMenuGoals_Click" Opened="ContextMenuGoals_Opened">
<MenuItem Header="Neues individuelles Ziel" >
<MenuItem.Icon>
<Image Source="..\..\Ressources\Icons\Add24.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Neue individuelle Maßnahme" >
<MenuItem.Icon>
<Image Source="..\..\Ressources\Icons\Add24.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Bearbeiten">
<MenuItem.Icon>
<Image Source="..\..\Ressources\Icons\Rename24.png"/>
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Löschen" >
<MenuItem.Icon>
<Image Source="..\..\Ressources\Icons\Delete24.png"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
<DataTemplate x:Key="detailCoreTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,0,0,0" Visibility="{Binding Path=Row.ShowNotice, Converter={StaticResource BoolVisibilityConverter}}"
Text="{Binding Path=Row.GoalEntryVM.Notice}" VerticalAlignment="Center"
BorderThickness="0" IsReadOnly="True" LostFocus="TextBox_LostFocus" KeyDown="TextBox_KeyDown" Background="Transparent"/>
</Grid>
</DataTemplate>
<DataTemplate x:Key="nodeToolTipTemplate">
<ContentPresenter Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}">
<ToolTipService.InitialShowDelay>200</ToolTipService.InitialShowDelay>
<ToolTipService.HasDropShadow>true</ToolTipService.HasDropShadow>
<ToolTipService.ShowDuration>50000</ToolTipService.ShowDuration>
<ToolTipService.ToolTip>
<ContentControl Content="{Binding}" ContentTemplate="{StaticResource detailCoreTemplate}" Tag="Transparent" MaxWidth="600"/>
</ToolTipService.ToolTip>
</ContentPresenter>
</DataTemplate>
</ResourceDictionary>
</localView:BeWoView.Resources>
<Grid x:Name="RootGrid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TabControl>
<TabItem>
<TabItem.Header>
<TextBlock Text="{markup:Translate Zugeordnete Ziele/Maßnahmen}" TextElement.FontSize="16" TextElement.Foreground="{StaticResource TabItemHotTextBrush}" TextElement.FontFamily="Microsoft Sans Serif" Padding="3"></TextBlock>
</TabItem.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button Margin="3,3,0,3" IsEnabled="{Binding Path=IsAllowedToEditGoals, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type view:SupportConceptView}}}"
Name="button_AddGoals" Click="button_AddGoals_Click"
HorizontalAlignment="Left">Ziele hinzufügen</Button>
</StackPanel>
<TreeView x:Name="treeview_Goals" Margin="3 3 7 3" Grid.Row="1" Padding="5 5 10 5"
ItemContainerStyle="{DynamicResource goal_treeitemstyle}"
ItemTemplate="{DynamicResource goal_treeitemtemplate}" MinHeight="100"
ContextMenu="{StaticResource cmGoals}"
PreviewMouseDown="GoalTreeViewItem_PreviewMouseRightButtonDown">
<TreeView.Resources>
<Style x:Key="goal_treeitemstyle" TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
</Style>
<HierarchicalDataTemplate x:Key="goal_treeitemtemplate"
DataType="{x:Type core:SupportConceptGoalTreeItem}"
ItemsSource="{Binding Path=Items}">
<Grid IsEnabled="{Binding Path=IsAllowedToEditGoals, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type view:SupportConceptView}}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--IsThreeState="{Binding Path=IsGoal,Converter={StaticResource BoolReverseConverter}}"-->
<TextBox x:Name="BdText" Tag="{Binding}" Grid.Row="0" Grid.Column="1" Margin="0, 0, 0, 0"
Text="{Binding Path=GoalEntryVM.DisplayName, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" Cursor="Arrow" Background="Transparent" Height="21" Padding="0" VerticalAlignment="Center"
LostFocus="TextBox_LostFocus" KeyDown="TextBox_KeyDown" BorderThickness="0"
FontWeight="{Binding Path=IsGoal, Converter={StaticResource ValueListEntryTypeToFontWeightConverter}}"
Foreground="{Binding Path=GoalType, Converter={StaticResource ValueListEntryTypeToColorConverter}}" ToolTipService.ShowDuration="100000">
<TextBox.ToolTip>
<StackPanel Orientation="Vertical">
<Label FontWeight="Bold" Content="{Binding Path=GoalEntryDC.TypeDescription, Mode=OneWay}"/>
<TextBox Background="Transparent" Padding="3,1,0,0" VerticalAlignment="Center" BorderThickness="0"
TextWrapping="Wrap"
AcceptsReturn="True"
MaxWidth="500"
IsReadOnly="True" Text="{Binding Path=GoalEntryDC.Notice}" />
</StackPanel>
</TextBox.ToolTip>
</TextBox>
</Grid>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
<!--<dxg:TreeListControl x:Name="treeview_Goals" VerticalAlignment="Stretch">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="Name" AllowSorting="True" Width="*"/>
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.View>
<dxg:TreeListView x:Name="GoalsTreeView" AllowEditing="False" AllowColumnFiltering="True" AutoExpandAllNodes="True"
ShowCheckboxes="False" AllowRecursiveNodeChecking="True"
ShowNodeImages="False" ShowFixedTotalSummary="False" IsTotalSummaryMenuEnabled="False"
ShowDataNavigator="False" ShowBandsPanel="False" ShowRootIndent="True" ShowIndicator="False" ShowColumnHeaders="False" ShowHorizontalLines="False" ShowVerticalLines="False"
ShowAutoFilterRow="True" KeyFieldName="KeyField" ParentFieldName="ParentField" AllowConditionalFormattingMenu="True" ShowCriteriaInAutoFilterRow="False"
>
-->
<!--DataRowTemplate="{StaticResource nodeToolTipTemplate}">-->
<!--
<dxg:TreeListView.FormatConditions>
<dxg:FormatCondition FieldName="Name" PredefinedFormatName="BoldText" Expression="!IsGoal" ApplyToRow="True" />
</dxg:TreeListView.FormatConditions>
-->
<!--<dxg:TreeListView.UseLightweightTemplates>
<dxg:UseLightweightTemplates>None</dxg:UseLightweightTemplates>
</dxg:TreeListView.UseLightweightTemplates>-->
<!--
</dxg:TreeListView>
</dxg:TreeListControl.View>
</dxg:TreeListControl>-->
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Text="{markup:Translate Bewertung}" TextElement.FontSize="16" TextElement.Foreground="{StaticResource TabItemHotTextBrush}" TextElement.FontFamily="Microsoft Sans Serif" Padding="3"></TextBlock>
</TabItem.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button Margin="3,3,0,3"
Name="button_AddRating" Click="button_AddRating_Click"
HorizontalAlignment="Left">Neue Bewertung erstellen</Button>
</StackPanel>
<ListView x:Name="listViewRatings" Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding Ratings.VMList}" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Left">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Focusable" Value="false" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#FF6A6A6A" Margin="3 3 3 5" CornerRadius="2" VerticalAlignment="Top" BorderThickness="1">
<Grid Margin="3" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Margin="3" VerticalAlignment="Center" FontWeight="Bold" Text="{markup:Translate Datum:}" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" HorizontalAlignment="Stretch"
EditValue="{Binding Path=StartDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Grid.Column="1" Margin="3" Width="85"
Height="23"/>
<TextBlock Margin="3" VerticalAlignment="Center" FontWeight="Bold"
Grid.Column="0" Grid.Row="1"
Text="{markup:Translate Bemerkungen:}" />
<Button VerticalAlignment="Center"
Grid.Column="6" Width="20"
Height="20" Tag="{Binding}"
Name="btn_deleteRating"
Click="btn_deleteRating_Click"
HorizontalAlignment="Right"
Style="{DynamicResource CloseButtonStyle}"
Margin="3 0 0 2" />
<TextBox x:Name="BdText" Tag="{Binding}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Margin="3" Height="60" Text="{Binding Path=DisplayName, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" Cursor="Arrow" Padding="1,3,1,3" VerticalAlignment="Center"
>
</TextBox>
<dxg:GridControl x:Name="grid_goalratings" Margin="3" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="7" DataSource="{Binding Path=Tasks.VMList, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Subject" Header="Ziel" Width="200"/>
<dxg:GridColumn FieldName="CompletedNotice" Header="Bewertung" Width="200"/>
<dxg:GridColumn FieldName="Notice" Header="Bemerkungen" Width="200"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView x:Name="gridViewGoal" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" MultiSelectMode="None" />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--<dxg:TreeListControl x:Name="treeview_Goals" VerticalAlignment="Stretch">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="Name" AllowSorting="True" Width="*"/>
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.View>
<dxg:TreeListView x:Name="GoalsTreeView" AllowEditing="False" AllowColumnFiltering="True" AutoExpandAllNodes="True"
ShowCheckboxes="False" AllowRecursiveNodeChecking="True"
ShowNodeImages="False" ShowFixedTotalSummary="False" IsTotalSummaryMenuEnabled="False"
ShowDataNavigator="False" ShowBandsPanel="False" ShowRootIndent="True" ShowIndicator="False" ShowColumnHeaders="False" ShowHorizontalLines="False" ShowVerticalLines="False"
ShowAutoFilterRow="True" KeyFieldName="KeyField" ParentFieldName="ParentField" AllowConditionalFormattingMenu="True" ShowCriteriaInAutoFilterRow="False"
>
-->
<!--DataRowTemplate="{StaticResource nodeToolTipTemplate}">-->
<!--
<dxg:TreeListView.FormatConditions>
<dxg:FormatCondition FieldName="Name" PredefinedFormatName="BoldText" Expression="!IsGoal" ApplyToRow="True" />
</dxg:TreeListView.FormatConditions>
-->
<!--<dxg:TreeListView.UseLightweightTemplates>
<dxg:UseLightweightTemplates>None</dxg:UseLightweightTemplates>
</dxg:TreeListView.UseLightweightTemplates>-->
<!--
</dxg:TreeListView>
</dxg:TreeListControl.View>
</dxg:TreeListControl>-->
</Grid>
</TabItem>
</TabControl>
<!--<GroupBox Grid.Row="1" Header="Individuelle Ziele" Style="{DynamicResource ObjectEditGroupBox}" Visibility="Collapsed">
<TreeView x:Name="treeview_individualGoals" Margin="3 3 7 3" Grid.Row="1" Padding="0 5 10 5"
ItemContainerStyle="{DynamicResource igoal_treeitemstyle}"
ItemTemplate="{DynamicResource igoal_treeitemtemplate}" Grid.RowSpan="1" ContextMenu="{StaticResource cmGoals}"
PreviewMouseDown="GoalTreeViewItem_PreviewMouseRightButtonDown" ItemsSource="{Binding IndividualGoalTree}" >
<TreeView.Resources>
<Style x:Key="igoal_treeitemstyle" TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
</Style>
<HierarchicalDataTemplate x:Key="igoal_treeitemtemplate" DataType="{x:Type Core:SupportConceptGoalTreeItem}" ItemsSource="{Binding Path=Items}">
<Grid IsEnabled="{Binding Path=IsAllowedToEditGoals, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type view:SupportConceptView}}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
-->
<!--<CheckBox Tag="{Binding}" IsChecked="{Binding Path=IsChecked}" Grid.Column="0" Margin="3 2" VerticalAlignment="Center" />-->
<!--<TextBlock Tag="{Binding}" Grid.Column="1" Margin="3 2" Text="{Binding Path=Name}" VerticalAlignment="Center" />-->
<!--
<TextBox Margin="0,0,0,0" Cursor="Arrow" Background="Transparent" Height="21" Padding="1,3,1,3" VerticalAlignment="Center" LostFocus="TextBox_LostFocus" KeyDown="TextBox_KeyDown" BorderThickness="0" IsReadOnly="True" Text="{Binding Path=ItemName, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
</GroupBox>-->
<StackPanel Grid.Row="2" Orientation="Horizontal">
<Button Margin="10 3 0 0"
Name="button_aufklappenAllGoals" Click="button_aufklappenAllGoals_Click"
HorizontalAlignment="Left">Alle aufklappen</Button>
<Button Margin="10 3 0 0"
Name="button_zuklappenAllGoals" Click="button_zuklappenAllGoals_Click"
HorizontalAlignment="Left">Alle zuklappen</Button>
</StackPanel>
</Grid>
</localView:BeWoView>