Textbausteine haben jetzt ein Kontextmenü und Textbausteinkategorien
This commit is contained in:
@@ -15,7 +15,6 @@ namespace BeWo.Core
|
||||
|
||||
private bool _IsExpanded;
|
||||
|
||||
|
||||
public TextModuleVM TextModuleVM { get; set; }
|
||||
|
||||
public string ItemName
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
|
||||
|
||||
<dxg:GridControl VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="7" x:Key="grid_medikamentenverordnungshistorie" HorizontalAlignment="Stretch"
|
||||
ItemsSource="{Binding Path=UngueltigeVerordnungen}" CustomColumnSort="Grid_medikamentenverordnungshistorie_OnCustomColumnSort">
|
||||
ItemsSource="{Binding Path=UngueltigeVerordnungen}" CustomColumnSort="Grid_medikamentenverordnungshistorie_OnCustomColumnSort">
|
||||
<dxg:GridControl.DetailDescriptor>
|
||||
<dxg:DataControlDetailDescriptor ItemsSourceBinding="{Binding Medikamentenverordnungen}">
|
||||
<dxg:DataControlDetailDescriptor ItemsSourceBinding="{Binding Medikamentenverordnungen}">
|
||||
<dxg:GridControl>
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="MedArt.Bezeichnung" Header="Med_Art" ReadOnly="True"/>
|
||||
|
||||
@@ -83,10 +83,7 @@ namespace BeWo.View.Detail
|
||||
|
||||
private int lastPosition;
|
||||
|
||||
public static double DocumentationTextBoxFontSize
|
||||
{
|
||||
get { return BeWoApp.AppSettings.DocumentationFontSize; }
|
||||
}
|
||||
public static double DocumentationTextBoxFontSize => BeWoApp.AppSettings.DocumentationFontSize;
|
||||
|
||||
public ServiceRecordView2(ServiceRecordListVM pViewModel, long? startSupportConceptOid)
|
||||
{
|
||||
@@ -3430,7 +3427,7 @@ namespace BeWo.View.Detail
|
||||
|
||||
rootGrid2.Children.Add(stackPanel);
|
||||
tbv.root.Header = string.Empty;
|
||||
var window = new BeWoWindow(tbv) { Width = 514, Height = 400, rootGroupBox = { Header = "Textbausteine" } };
|
||||
var window = new BeWoWindow(tbv) { Width = 914, Height = 600, rootGroupBox = { Header = "Textbausteine" } };
|
||||
|
||||
speichernBtn.Click += (o, args) =>
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
VerticalAlignment="Stretch" Focusable="True">
|
||||
<view:BeWoView.Resources>
|
||||
<detail:IsOnlyForEmployeeRightsConverter x:Key="IsOnlyForEmployeeRightsConverter" />
|
||||
<detail:TextModuleEditConverter x:Key="TextModuleEditConverter" />
|
||||
<detail:TextModuleEditConverter x:Key="TextModuleEditConverter" />
|
||||
</view:BeWoView.Resources>
|
||||
<GroupBox Name="root" Style="{StaticResource ObjectEditGroupBox}">
|
||||
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
|
||||
@@ -11,9 +11,24 @@
|
||||
VerticalAlignment="Stretch" Focusable="True">
|
||||
<view:BeWoView.Resources>
|
||||
<detail:IsOnlyForEmployeeRightsConverter x:Key="IsOnlyForEmployeeRightsConverter" />
|
||||
</view:BeWoView.Resources>
|
||||
<detail:TextModuleEditConverter x:Key="TextModuleEditConverter" />
|
||||
</view:BeWoView.Resources>
|
||||
<GroupBox Name="root" Header="Aktuell definierte Textbausteine" Style="{StaticResource ObjectEditGroupBox}">
|
||||
<Grid VerticalAlignment="Stretch">
|
||||
<Grid.Resources>
|
||||
<ContextMenu x:Key="ContextMenuTextModules" MenuItem.Click="ContextMenuTextModules_Click" Opened="ContextMenuTextModules_Opened">
|
||||
<MenuItem Header="Neue Textbausteinkategorie">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Neuer Textbaustein">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
@@ -21,6 +36,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -46,78 +62,164 @@
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5" AcceptsReturn="True" MaxWidth="469" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Height="100" Margin="0,3,0,0" Text="{Binding Path=NewVM.Text, UpdateSourceTrigger=PropertyChanged}"></TextBox>
|
||||
<Button Grid.Column="4" Grid.Row="2" x:Name="AddTextbausteinButton" Margin="3" HorizontalAlignment="Right" Grid.ColumnSpan="2" Click="ButtonAddTextbaustein_Click">Hinzufügen</Button>
|
||||
</Grid>
|
||||
<dxg:GridControl Grid.Column="0" Grid.Row="1" x:Name="datagrid_textbausteine" Margin="0,10,0,0" DataSource="{Binding VMList}">
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="r" Click="DeleteButton_Click" IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Name" Header="Name">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Position" Header="Position">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:SpinEdit EditMode="InplaceInactive" MinValue="0" IsFloatValue="False"
|
||||
Value="{Binding Path=DataContext.RowData.Row.Position, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:SpinEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:SpinEdit x:Name="PART_Editor" EditMode="InplaceActive" MinValue="0" IsFloatValue="False"
|
||||
Value="{Binding Path=DataContext.RowData.Row.Position, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:SpinEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Text" Header="Text">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn Header="Nur für Ersteller sichtbar" x:Name="EigenerTextbausteinSpalte">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<dxe:CheckEdit HorizontalAlignment="Center"
|
||||
IsChecked="{Binding Path=DataContext.RowData.Row.IsOnlyForEmployee, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, ConverterParameter=IsOnlyForEmployeeCheckBox, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="ServiceCategory" Header="Kategorie">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings ItemsSource="{Binding Path=PossibleCategories}"></dxe:ComboBoxEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:GridControl Grid.Column="0" Grid.Row="1" x:Name="DatagridTextbausteine" Margin="0,10,0,0" ItemsSource="{Binding VMList}" Visibility="Collapsed">
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="r" Click="DeleteButton_Click" IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Name" Header="Name">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Position" Header="Position">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:SpinEdit EditMode="InplaceInactive" MinValue="0" IsFloatValue="False"
|
||||
Value="{Binding Path=DataContext.RowData.Row.Position, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:SpinEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:SpinEdit x:Name="PART_Editor" EditMode="InplaceActive" MinValue="0" IsFloatValue="False"
|
||||
Value="{Binding Path=DataContext.RowData.Row.Position, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"></dxe:SpinEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Text" Header="Text">
|
||||
<dxg:GridColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.DisplayTemplate>
|
||||
<dxg:GridColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive"
|
||||
Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn Header="Nur für Ersteller sichtbar" x:Name="EigenerTextbausteinSpalte">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<dxe:CheckEdit HorizontalAlignment="Center"
|
||||
IsChecked="{Binding Path=DataContext.RowData.Row.IsOnlyForEmployee, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, ConverterParameter=IsOnlyForEmployeeCheckBox, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="ServiceCategory" Header="Kategorie">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:ComboBoxEditSettings ItemsSource="{Binding Path=PossibleCategories}"></dxe:ComboBoxEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" ShowingEditor="GridViewBase_OnShowingEditor" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
</Grid>
|
||||
<dxg:TreeListControl Name="TreeListControl" Grid.Column="0" Grid.Row="1" ItemsSource="{Binding Path=VMList}" Margin="0,15,0,0" ContextMenu="{StaticResource ContextMenuTextModules}">
|
||||
<dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True">
|
||||
<dxg:TreeListColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="r" Click="DeleteButton_Click" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center">
|
||||
<Button.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
<Binding Path="DataContext.RowData.Row" RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Button.IsEnabled>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</dxg:TreeListColumn.CellTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
<dxg:TreeListColumn FieldName="Name">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
<Binding Path="DataContext.RowData.Row" RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</dxe:TextEdit.IsEnabled>
|
||||
</dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
<Binding Path="DataContext.RowData.Row" RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</dxe:TextEdit.IsEnabled>
|
||||
</dxe:TextEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.EditTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
<dxg:TreeListColumn FieldName="Text">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.EditTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
<dxg:TreeListColumn FieldName="ServiceCategory" Header="Leistungskategorie" AllowEditing="{Binding Path=DataContext.RowData.Row, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit EditMode="InplaceActive" IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit x:Name="PART_Editor" EditMode="InplaceActive" IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.EditTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
<dxg:TreeListColumn FieldName="Parent" Header="Textbausteinkategorie">
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit x:Name="PART_Editor" EditMode="InplaceActive"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleTextModuleParents, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.Parent, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.EditTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
</dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListControl.View>
|
||||
<dxg:TreeListView Name="TreeListView" AutoWidth="True" KeyFieldName="KeyField" ParentFieldName="ParentField" />
|
||||
</dxg:TreeListControl.View>
|
||||
</dxg:TreeListControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</view:BeWoView>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
using BeWo.Core;
|
||||
@@ -25,7 +26,7 @@ namespace BeWo.View.Detail
|
||||
|
||||
public TextModuleListVM ViewModel
|
||||
{
|
||||
get { return _ViewModel; }
|
||||
get => _ViewModel;
|
||||
|
||||
set
|
||||
{
|
||||
@@ -34,15 +35,9 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsDirty
|
||||
{
|
||||
get { return ViewModel != null && ViewModel.IsDirty; }
|
||||
}
|
||||
public override bool IsDirty => ViewModel != null && ViewModel.IsDirty;
|
||||
|
||||
internal override DependencyObject ValidationOnSaveRootElement
|
||||
{
|
||||
get { return AddTextbausteinButton; }
|
||||
}
|
||||
internal override DependencyObject ValidationOnSaveRootElement => AddTextbausteinButton;
|
||||
|
||||
private bool isInAdministrationView;
|
||||
|
||||
@@ -112,8 +107,8 @@ namespace BeWo.View.Detail
|
||||
|
||||
private void DeleteButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.VMList.Remove(datagrid_textbausteine.GetCurrentValue<TextModuleVM>());
|
||||
BeWoWpfUtils.RefreshDXGrid(datagrid_textbausteine);
|
||||
ViewModel.VMList.Remove(DatagridTextbausteine.GetCurrentValue<TextModuleVM>());
|
||||
BeWoWpfUtils.RefreshDXGrid(DatagridTextbausteine);
|
||||
}
|
||||
|
||||
private void ButtonAddTextbaustein_Click(object sender, RoutedEventArgs e)
|
||||
@@ -151,8 +146,50 @@ namespace BeWo.View.Detail
|
||||
|
||||
return isOwn && hasRight2EditOwn || hasRight2EditAll;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Merken, ob die Textmodulkategorie aufgeklappt ist.
|
||||
// TODO: Speichern und Schließen statt der bisherigen Lösung.
|
||||
private void ContextMenuTextModules_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(e.OriginalSource is MenuItem twi)
|
||||
{
|
||||
var selectedItem = TreeListControl.SelectedItem as TextModuleVM;
|
||||
|
||||
ViewModel.NewVM.IsParent = twi.Header.Equals("Neue Textbausteinkategorie");
|
||||
ViewModel.NewVM.IsOnlyForEmployee = true;
|
||||
|
||||
if(selectedItem != null)
|
||||
{
|
||||
ViewModel.NewVM.Parent = selectedItem;
|
||||
}
|
||||
|
||||
ViewModel.AddNewVMToList(false);
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void ContextMenuTextModules_Opened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is ContextMenu menu)
|
||||
{
|
||||
var textModule = TreeListControl.SelectedItem as TextModuleVM;
|
||||
|
||||
foreach (var menuitem in menu.Items.OfType<MenuItem>().Select(item => item))
|
||||
{
|
||||
if(textModule == null || !textModule.IsParent)
|
||||
{
|
||||
menuitem.IsEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuitem.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class IsOnlyForEmployeeRightsConverter : IValueConverter
|
||||
|
||||
Reference in New Issue
Block a user