Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit af888b70 authored by Harald Martini's avatar Harald Martini
Browse files

Added MinHeight and MinWidth Properties to ViewModelBase

parent b29a0ead
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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
{
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment