diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index b2df90090..2971bd33d 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -905,6 +905,7 @@ + diff --git a/BeWo/Converter/Object2ToStringConverter.cs b/BeWo/Converter/Object2ToStringConverter.cs new file mode 100644 index 000000000..a48163981 --- /dev/null +++ b/BeWo/Converter/Object2ToStringConverter.cs @@ -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(); + } + } +} \ No newline at end of file diff --git a/BeWo/Styles/OrangeBlack.xaml b/BeWo/Styles/OrangeBlack.xaml index c0520e55a..80e9c7678 100644 --- a/BeWo/Styles/OrangeBlack.xaml +++ b/BeWo/Styles/OrangeBlack.xaml @@ -3366,7 +3366,8 @@ - + - + @@ -115,13 +121,13 @@ - + - - + + @@ -137,7 +143,7 @@ - + @@ -174,76 +180,11 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - zu Partner/Partnerin - zu Partner/Partnerin - - zu eigenen minderjährigen Kindern - zu eigenen minderjährigen Kindern - - zu volljährigen Kindern, Eltern, Verwandten - zu volljährigen Kindern, Eltern, Verwandten - - zu Freunden/Freundinnen, Bekannten - zu Freunden/Freundinnen, Bekannten - - zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä. - zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä. - - sonstige - sonstige - - - - - - - - - - - - - - - - - - - - - - @@ -315,6 +256,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + zu Partner/Partnerin + zu eigenen minderjährigen Kindern + zu volljährigen Kindern, Eltern, Verwandten + zu Freunden/Freundinnen, Bekannten + zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä. + sonstige + + + + zu Partner/Partnerin + zu eigenen minderjährigen Kindern + zu volljährigen Kindern, Eltern, Verwandten + zu Freunden/Freundinnen, Bekannten + zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä. + sonstige + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs index 56f8edb84..c913ddbf2 100644 --- a/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs +++ b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs @@ -20,14 +20,87 @@ namespace BeWo.View.Controls.Wohnhilfe /// 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); } } } diff --git a/BeWo/View/Detail/CustomerWohnhilfeView.xaml b/BeWo/View/Detail/CustomerWohnhilfeView.xaml index 7cd54d643..adb7582bb 100644 --- a/BeWo/View/Detail/CustomerWohnhilfeView.xaml +++ b/BeWo/View/Detail/CustomerWohnhilfeView.xaml @@ -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">