Responsive Design

- Button Click muss noch IsLarge in Control triggern
This commit is contained in:
2024-09-06 15:22:48 +02:00
parent e90d5c35be
commit d69164fda2
10 changed files with 236 additions and 101 deletions

View File

@@ -905,6 +905,7 @@
<Compile Include="Converter\ClientType2VisibilityConverter.cs" />
<Compile Include="Converter\BoolVisibilityMultiConverter.cs" />
<Compile Include="Converter\NullableBoolToBoolConverter.cs" />
<Compile Include="Converter\Object2ToStringConverter.cs" />
<Compile Include="Converter\ParticipationBrushConverter.cs" />
<Compile Include="Converter\ArchiveRight2VisibilityConverter.cs" />
<Compile Include="Converter\ReactivationRight2VisibilityConverter.cs" />

View File

@@ -0,0 +1,22 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace BeWo.Converter
{
public class Object2ToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is object)
return value.ToString();
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -3366,7 +3366,8 @@
<Style x:Key="ObjectEditGroupBox" TargetType="{x:Type GroupBox}">
<!-- <Setter Property="BorderBrush" Value="#D5DFE5" />-->
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter Property="Padding" Value="3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="true">
@@ -3383,7 +3384,7 @@
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" />
</Border>
<Border Grid.Row="1" BorderBrush="#FF86878F" BorderThickness="0,0,0,1" />
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="0" Grid.Row="2" Margin="3,3,3,3" />
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="0" Grid.Row="2" Margin="{TemplateBinding Padding}"/>
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@@ -1,10 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:conv="clr-namespace:BeWo.Converter"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxei="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal"
xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
>
<Style x:Key="TitleLabel" TargetType="Label">
<Setter Property="TextElement.FontSize" Value="16" />
@@ -13,7 +15,7 @@
<Setter Property="Padding" Value="3,0,3,0" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="3, 4, 3, 6"/>
<Setter Property="Margin" Value="3, -6, 3, 6"/>
</Style>
<Style TargetType="uc:NullItemComboBox" BasedOn="{StaticResource {x:Type uc:NullItemComboBox}}">
<Setter Property="Margin" Value="3"/>
@@ -22,10 +24,13 @@
<Setter Property="Margin" Value="3"/>
<Setter Property="Height" Value="23"/>
</Style>
<Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type RadioButton}}">
<Style TargetType="RadioButton">
<Setter Property="Margin" Value="3"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="3"/>
</Style>
<!--<Style TargetType="dxe:DateEdit" BasedOn="{StaticResource {x:Type dxe:DateEdit}}" x:Shared="False">
<Setter Property="Margin" Value="3"/>
<Setter Property="Height" Value="23"/>
@@ -76,4 +81,7 @@
</DataTemplate>
</Style.Resources>
</Style>
<Style TargetType="{x:Type StackPanel}">
</Style>
</ResourceDictionary>

View File

@@ -1,4 +1,5 @@
<UserControl x:Class="BeWo.View.Controls.Wohnhilfe.CustomerWohnhilfeControl"
<UserControl x:Name="root_usercontrol"
x:Class="BeWo.View.Controls.Wohnhilfe.CustomerWohnhilfeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -12,49 +13,54 @@
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxei="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal"
xmlns:wohnhilfe="clr-namespace:BeWo.View.Controls.Wohnhilfe"
Loaded="UserControl_Loaded"
xmlns:cs="ignorablePrefix"
mc:Ignorable="d cs"
d:DataContext="{d:DesignInstance Type=viewmodel:CustomerWohnhilfeVM, IsDesignTimeCreatable=true}"
d:DesignHeight="1450" d:DesignWidth="1800">
d:DesignHeight="1450" d:DesignWidth="1800" SizeChanged="UserControl_SizeChanged">
<UserControl.Resources>
<Style TargetType="GroupBox" BasedOn="{StaticResource ObjectEditGroupBox}">
<Setter Property="Margin" Value="10"/>
<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource ObjectEditGroupBox}">
<Setter Property="Margin" Value="15"/>
<Setter Property="Padding" Value="10, 7, 7, 5"/>
</Style>
<DataTemplate x:Key="ListItemView">
<TextBlock Text="{Binding Path=., Converter={StaticResource EnumTranslationConverter}}"/>
<TextBlock Text="{Binding Path=., Converter={StaticResource EnumTranslationConverter}}"
ToolTip="{Binding Path=Text, RelativeSource={RelativeSource Self}}"
TextWrapping="Wrap"
/>
</DataTemplate>
<Style TargetType="uc:NullItemComboBox" BasedOn="{StaticResource {x:Type uc:NullItemComboBox}}">
<Style TargetType="{x:Type uc:NullItemComboBox}" BasedOn="{StaticResource {x:Type uc:NullItemComboBox}}">
<Setter Property="ItemTemplate" Value="{StaticResource ListItemView}"/>
</Style>
<Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="ItemTemplate" Value="{StaticResource ListItemView}"/>
</Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="20, 3, 3, 3"/>
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}">
<Setter Property="Margin" Value="3"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
<Setter Property="Margin" Value="20, 3, 3, 3"/>
<Style x:Key="StackpanelDetailsStyle" TargetType="{x:Type StackPanel}" BasedOn="{StaticResource {x:Type StackPanel}}">
<Setter Property="Margin" Value="40, -1, 0, 3"/>
</Style>
</UserControl.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid>
<ScrollViewer x:Name="scrollviewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Grid x:Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition x:Name="grid_secondcolumn" Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--<GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" x:Name="EintraegeGrid" Style="{StaticResource ObjectEditGroupBox}" Header="Notizen">
</GroupBox>-->
<GroupBox Grid.Row="0" Grid.Column="0" DataContext="{Binding BereichBundVM}" Header="Bereich Bund">
<GroupBox x:Name="groupbox_1" Grid.Row="0" Grid.Column="0" DataContext="{Binding BereichBundVM}" Header="Bereich Bund" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
@@ -115,13 +121,13 @@
</GroupBox>
<GroupBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" DataContext="{Binding BereichEinkommenUndArbeitVM}" Header="Bereich Einkommen und Arbeit">
<GroupBox x:Name="groupbox_2" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="1" DataContext="{Binding BereichEinkommenUndArbeitVM}" Header="Bereich Einkommen und Arbeit">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
@@ -137,7 +143,7 @@
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">zu Beginn</Label>
<Rectangle Grid.Row="0" Grid.Column="2" Grid.RowSpan="20" VerticalAlignment="Stretch" Fill="Black" Width="1" Margin="5,0,5,0"/>
<Rectangle Grid.Row="0" Grid.Column="2" Grid.RowSpan="20" VerticalAlignment="Stretch" Fill="Black" Width="1" Margin="10,0,10,0"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">am Ende</Label>
<Label Grid.Row="1" Grid.Column="0">W2010 Einkommenssituation</Label>
@@ -174,76 +180,11 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" DataContext="{Binding BereichSozialeKontakteVM}" Header="Bereich Soziale Kontakte" >
<GroupBox x:Name="groupbox_3" Grid.Row="1" Grid.Column="0" DataContext="{Binding BereichSozialstrukturVM}" Header="Bereich Sozialstruktur" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">zu Beginn</Label>
<Rectangle Grid.Row="0" Grid.Column="2" Grid.RowSpan="20" VerticalAlignment="Stretch" Fill="Black" Width="1" Margin="5,0,5,0"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">am Ende</Label>
<Label Grid.Row="1" Grid.Column="0">W4010 Soziale Kontakte</Label>
<ComboBox Grid.Row="1" Grid.Column="1" SelectedValue="{Binding BeginnSozialeKontakte}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="1" Grid.Column="3">W4020 Soziale Kontakte</Label>
<ComboBox Grid.Row="1" Grid.Column="4" SelectedValue="{Binding EndeSozialeKontakte}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="20, -3, 3, 3" IsChecked="{Binding BeginnKontaktPartner}">zu Partner/Partnerin</CheckBox>
<CheckBox Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="2" Margin="20, -3, 3, 3" IsChecked="{Binding EndeKontaktPartner}">zu Partner/Partnerin</CheckBox>
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding BeginnKontaktMindKinder}">zu eigenen minderjährigen Kindern</CheckBox>
<CheckBox Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="2" IsChecked="{Binding EndeKontaktMindKinder}">zu eigenen minderjährigen Kindern</CheckBox>
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding BeginnKontaktVolljahrKinderElternVerwandten}">zu volljährigen Kindern, Eltern, Verwandten</CheckBox>
<CheckBox Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="2" IsChecked="{Binding EndeKontaktVolljahrKinderElternVerwandten}">zu volljährigen Kindern, Eltern, Verwandten</CheckBox>
<CheckBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding BeginnKontaktFreundenBekannten}">zu Freunden/Freundinnen, Bekannten</CheckBox>
<CheckBox Grid.Row="5" Grid.Column="3" Grid.ColumnSpan="2" IsChecked="{Binding EndeKontaktFreundenBekannten}">zu Freunden/Freundinnen, Bekannten</CheckBox>
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding BeginnKontaktSelbsthilfe}">zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.</CheckBox>
<CheckBox Grid.Row="6" Grid.Column="3" Grid.ColumnSpan="2" IsChecked="{Binding EndeKontaktSelbsthilfe}">zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.</CheckBox>
<CheckBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="20, 3, 3, 6" IsChecked="{Binding BeginnKontaktSonstige}">sonstige</CheckBox>
<CheckBox Grid.Row="7" Grid.Column="3" Grid.ColumnSpan="2" Margin="20, 3, 3, 6" IsChecked="{Binding EndeKontaktSonstige}">sonstige</CheckBox>
<Label Grid.Row="8" Grid.Column="0">W4030 Krankenversicherung</Label>
<ComboBox Grid.Row="8" Grid.Column="1" SelectedValue="{Binding BeginnKrankenversicherung}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="8" Grid.Column="3">W4040 Krankenversicherung</Label>
<ComboBox Grid.Row="8" Grid.Column="4" SelectedValue="{Binding EndeKrankenversicherung}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="9" Grid.Column="0">W4050 Kontakt zu e. Arzt innerhalb der letzten 6 Monate</Label>
<ComboBox Grid.Row="9" Grid.Column="1" SelectedValue="{Binding BeginnKontaktArzt}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="9" Grid.Column="3">W4060 Kontakt zu e. Arzt innerhalb der letzten 6 Monate</Label>
<ComboBox Grid.Row="9" Grid.Column="4" SelectedValue="{Binding EndeKontaktArzt}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="10" Grid.Column="0">W4070 Vorlage eines Schwerbegindertenausweises</Label>
<ComboBox Grid.Row="10" Grid.Column="1" SelectedValue="{Binding VorlageSchwerbehindertenausweises}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Grid.Column="0" DataContext="{Binding BereichSozialstrukturVM}" Header="Bereich Sozialstruktur" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
@@ -315,6 +256,66 @@
<ComboBox Grid.Row="15" Grid.Column="1" Margin="3, -2, 3, 3" SelectedValue="{Binding EigeneMindKinderAuserhalbHaushaltsstruktur}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
</Grid>
</GroupBox>
<GroupBox x:Name="groupbox_4" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1" DataContext="{Binding BereichSozialeKontakteVM}" Header="Bereich Soziale Kontakte" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">zu Beginn</Label>
<Rectangle Grid.Row="0" Grid.Column="2" Grid.RowSpan="20" VerticalAlignment="Stretch" Fill="Black" Width="1" Margin="5,0,5,0"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" Style="{StaticResource TitleLabel}">am Ende</Label>
<Label Grid.Row="1" Grid.Column="0">W4010 Soziale Kontakte</Label>
<ComboBox Grid.Row="1" Grid.Column="1" SelectedValue="{Binding BeginnSozialeKontakte}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="1" Grid.Column="3">W4020 Soziale Kontakte</Label>
<ComboBox Grid.Row="1" Grid.Column="4" SelectedValue="{Binding EndeSozialeKontakte}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource StackpanelDetailsStyle}">
<CheckBox IsChecked="{Binding BeginnKontaktPartner}">zu Partner/Partnerin</CheckBox>
<CheckBox IsChecked="{Binding BeginnKontaktMindKinder}">zu eigenen minderjährigen Kindern</CheckBox>
<CheckBox IsChecked="{Binding BeginnKontaktVolljahrKinderElternVerwandten}">zu volljährigen Kindern, Eltern, Verwandten</CheckBox>
<CheckBox IsChecked="{Binding BeginnKontaktFreundenBekannten}">zu Freunden/Freundinnen, Bekannten</CheckBox>
<CheckBox IsChecked="{Binding BeginnKontaktSelbsthilfe}">zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.</CheckBox>
<CheckBox IsChecked="{Binding BeginnKontaktSonstige}">sonstige</CheckBox>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="2" Style="{StaticResource StackpanelDetailsStyle}">
<CheckBox IsChecked="{Binding EndeKontaktPartner}">zu Partner/Partnerin</CheckBox>
<CheckBox IsChecked="{Binding EndeKontaktMindKinder}">zu eigenen minderjährigen Kindern</CheckBox>
<CheckBox IsChecked="{Binding EndeKontaktVolljahrKinderElternVerwandten}">zu volljährigen Kindern, Eltern, Verwandten</CheckBox>
<CheckBox IsChecked="{Binding EndeKontaktFreundenBekannten}">zu Freunden/Freundinnen, Bekannten</CheckBox>
<CheckBox IsChecked="{Binding EndeKontaktSelbsthilfe}">zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.</CheckBox>
<CheckBox IsChecked="{Binding EndeKontaktSonstige}">sonstige</CheckBox>
</StackPanel>
<Label Grid.Row="3" Grid.Column="0">W4030 Krankenversicherung</Label>
<ComboBox Grid.Row="3" Grid.Column="1" SelectedValue="{Binding BeginnKrankenversicherung}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="3" Grid.Column="3">W4040 Krankenversicherung</Label>
<ComboBox Grid.Row="3" Grid.Column="4" SelectedValue="{Binding EndeKrankenversicherung}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="4" Grid.Column="0">W4050 Kontakt zu e. Arzt innerhalb der letzten 6 Monate</Label>
<ComboBox Grid.Row="4" Grid.Column="1" SelectedValue="{Binding BeginnKontaktArzt}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="4" Grid.Column="3">W4060 Kontakt zu e. Arzt innerhalb der letzten 6 Monate</Label>
<ComboBox Grid.Row="4" Grid.Column="4" SelectedValue="{Binding EndeKontaktArzt}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
<Label Grid.Row="5" Grid.Column="0">W4070 Vorlage eines Schwerbegindertenausweises</Label>
<ComboBox Grid.Row="5" Grid.Column="1" SelectedValue="{Binding VorlageSchwerbehindertenausweises}" ItemsSource="{Binding WohnhilfeBoolDataTypes}"/>
</Grid>
</GroupBox>
</Grid>
</ScrollViewer>
</UserControl>

View File

@@ -20,14 +20,87 @@ namespace BeWo.View.Controls.Wohnhilfe
/// </summary>
public partial class CustomerWohnhilfeControl : UserControl
{
public bool IsLarge
{
get { return (bool)GetValue(IsLargeProperty); }
set { SetValue(IsLargeProperty, value); }
}
// Using a DependencyProperty as the backing store for IsLarge. This enables animation, styling, binding, etc...
public static readonly DependencyProperty IsLargeProperty =
DependencyProperty.Register("IsLarge", typeof(bool), typeof(CustomerWohnhilfeControl), new PropertyMetadata(false));
public double MinWidthGrid { get; set; }
public double ParentWidth
{
get { return (double)GetValue(ParentWidthProperty); }
set { SetValue(ParentWidthProperty, value); }
}
// Using a DependencyProperty as the backing store for ParentWidth. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ParentWidthProperty =
DependencyProperty.Register("ParentWidth", typeof(double), typeof(CustomerWohnhilfeControl), new PropertyMetadata(0.0d));
public CustomerWohnhilfeControl()
{
InitializeComponent();
root_usercontrol.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
var size = root_usercontrol.DesiredSize;
MinWidthGrid = size.Width;
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
//Combobox.Style = null;
if (e.WidthChanged)
{
var parent_width = ParentWidth;
if (parent_width > MinWidthGrid + 50)
{
SetLarge();
}
else
{
SetSmall();
}
}
}
private void SetLarge()
{
if (IsLarge)
return;
IsLarge = true;
grid_secondcolumn.Width = new GridLength(2, GridUnitType.Star);
Grid.SetColumn(groupbox_2, 1);
Grid.SetRow(groupbox_2, 0);
Grid.SetColumn(groupbox_3, 0);
Grid.SetRow(groupbox_3, 1);
Grid.SetColumn(groupbox_4, 1);
Grid.SetRow(groupbox_4, 1);
}
private void SetSmall()
{
if (!IsLarge)
return;
IsLarge = false;
grid_secondcolumn.Width = new GridLength(0);
Grid.SetColumn(groupbox_2, 0);
Grid.SetRow(groupbox_2, 1);
Grid.SetColumn(groupbox_3, 0);
Grid.SetRow(groupbox_3, 2);
Grid.SetColumn(groupbox_4, 0);
Grid.SetRow(groupbox_4, 3);
}
}
}

View File

@@ -8,10 +8,12 @@
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:wohnhilfe="clr-namespace:BeWo.View.Controls.Wohnhilfe" xmlns:converter="clr-namespace:BeWo.Converter"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:wohnhilfe="clr-namespace:BeWo.View.Controls.Wohnhilfe"
xmlns:converter="clr-namespace:BeWo.Converter"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=viewmodel:CustomerVM, IsDesignTimeCreatable=true}"
d:DesignHeight="450" d:DesignWidth="800">
d:DesignHeight="450" d:DesignWidth="800" SizeChanged="root_control_SizeChanged">
<UserControl.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Margin" Value="3"/>
@@ -29,7 +31,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<Button Content="Neue Wohnhilfe hinzufügen" Command="{Binding AddWohnhilfeCommand}">
<!--<Button.Style>
<Style TargetType="Button"
@@ -59,6 +61,9 @@
</Button.Visibility>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<CheckBox x:Name="checkbox_size" IsChecked="{Binding Path=IsLarge, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">Groß</CheckBox>
</StackPanel>
<TabControl Grid.Row="1" Margin="5"
ItemsSource="{Binding VMList}"
SelectedItem="{Binding SelectedVM}" x:Name="tabcontrol_NotizenKategorien"
@@ -95,7 +100,9 @@
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<wohnhilfe:CustomerWohnhilfeControl/>
<wohnhilfe:CustomerWohnhilfeControl
ParentWidth="{Binding Path=ActualWidth, ElementName=tabcontrol_NotizenKategorien}"
IsLarge="{Binding Path=DataContext.IsLarge, ElementName=tabcontrol_NotizenKategorien, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>

View File

@@ -44,5 +44,10 @@ namespace BeWo.View.Detail
txt_Wohnhilfe_Displayname_Edit.Focus();
txt_Wohnhilfe_Displayname_Edit.SelectAll();
}
private void root_control_SizeChanged(object sender, SizeChangedEventArgs e)
{
}
}
}

View File

@@ -37,7 +37,7 @@ namespace BeWo.ViewModel
public CustomerWohnhilfeVM(CustomerWohnhilfeDC dc) : base(dc, dc.Oid == null)
{
}
public override bool IsDirty => base.IsDirty ||

View File

@@ -12,6 +12,8 @@ namespace BeWo.ViewModel.ListViewModel
{
public class CustomerWohnhilfeListVM : AbstractDCListMapperVM<CustomerWohnhilfeDC, CustomerWohnhilfeVM>
{
private bool _IsLarge;
public DelegateCommand AddWohnhilfeCommand { get; set; }
public DelegateCommand DeleteWohnhilfeCommand { get; set; }
public DelegateCommand CopySelectedWohnhilfeCommand { get; set; }
@@ -32,6 +34,21 @@ namespace BeWo.ViewModel.ListViewModel
CopySelectedWohnhilfeCommand = new DelegateCommand(CopySelectedWohnhilfe);
InsertDetailsCommand = new DelegateCommand(InsertDetails);
_IsLarge = true;
}
public bool IsLarge
{
get { return _IsLarge; }
set
{
if (!AreDifferent(IsLarge, value))
return;
_IsLarge = value;
FirePropertyChanged(nameof(IsLarge));
}
}
public void CopySelectedWohnhilfe()