luigimelisi.com
Come Espandere una Window Wpf solo orizzontalmente o verticalmente. - Luigi Melisi
Per massimizzare un Window WPF solo orizzontalmento verticalmente basta usare queste poche e semplici linee di codice : public partial class MyWindow : Window { public MyWindow() { InitializeComponent(); FillHeight(); } private void FillHeight() { PropertyChangedCallback tmpChanged = (source, args) => { var workArea = (Rect)args.NewValue; this.Height = workArea.Height; }; DependencyProperty tmp = DependencyProperty.Register(“tmp”, typeof (Rect), typeof (Window), new PropertyMetadata(new PropertyChangedCallback(tmpChanged))); this.SetResourceReference(tmp, SystemParameters.WorkAreaKey); } }