diff --git a/VECTO3GUI2020/Helper/WindowHelper.cs b/VECTO3GUI2020/Helper/WindowHelper.cs index 5e5bc2b3004a6b8489dddc0a18c224b0f2bcb321..5e74748502d2a28ff66d15ee3c4cc8a22fb7d464 100644 --- a/VECTO3GUI2020/Helper/WindowHelper.cs +++ b/VECTO3GUI2020/Helper/WindowHelper.cs @@ -19,12 +19,16 @@ namespace VECTO3GUI2020.Helper var width = viewModelBase?.Height ?? Double.NaN; var sizeToContent = viewModelBase?.SizeToContent ?? SizeToContent.Manual; var title = viewModelBase?.Title ?? GUILabels.DefaultTitle; + var minHeight = viewModelBase?.MinHeight ?? 0; + var minWidth = viewModelBase?.MinWidth ?? 0; var window = new Window { Content = viewModel, Height = height, Width = width, + MinHeight = minHeight, + MinWidth = minWidth, SizeToContent = sizeToContent, WindowStartupLocation = WindowStartupLocation.CenterScreen, Title = title @@ -34,6 +38,10 @@ namespace VECTO3GUI2020.Helper SetBinding(viewModelBase, window, new PropertyPath(nameof(viewModelBase.Width)), FrameworkElement.WidthProperty); SetBinding(viewModelBase, window, new PropertyPath(nameof(viewModelBase.SizeToContent)), Window.SizeToContentProperty); SetBinding(viewModelBase, window, new PropertyPath(nameof(viewModelBase.Title)), Window.TitleProperty); + SetBinding(viewModelBase, window, new PropertyPath(nameof(viewModelBase.SizeToContent)), Window.SizeToContentProperty); + SetBinding(viewModelBase, window, new PropertyPath(nameof(viewModelBase.Title)), Window.TitleProperty); + + } diff --git a/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs b/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs index 31cc9dd1815e5164f462465920570d49dca4f952..48648b455e4d6036ad515e4384a9fc58cd9e2463 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs @@ -31,6 +31,22 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Common set => SetProperty(ref _height, value); } + private double? _minHeight; + + public double? MinHeight + { + get => _minHeight; + set => SetProperty(ref _minHeight, value); + } + + private double? _minWidth; + + public double? MinWidth + { + get => _minWidth; + set => SetProperty(ref _minWidth, value); + } + public SizeToContent _sizeToContent = SizeToContent.Manual; public SizeToContent SizeToContent { diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs b/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs index f998400748f53331737cf683f599bdce9d86954a..407034e20c9334ae4d18c12e581382ccdf1cd28e 100644 --- a/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs +++ b/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs @@ -8,6 +8,9 @@ namespace VECTO3GUI2020.ViewModel.Interfaces.Common string Title { get; set; } double? Width { get; set; } double? Height { get; set; } + + double? MinHeight { get; set; } + double? MinWidth { get; set; } SizeToContent SizeToContent { get; set; } } } \ No newline at end of file