public static FrameworkElement BuildControl(ShellViewModel model) { model.Header.ShowIconAndTitle = false; model.AllowClose = false; model.AllowHelp = false; model.AllowMaximize = false; model.AllowMinimize = false; model.Width = double.NaN; model.Height = double.NaN; var frameworkElement = new ScrollViewer() { Content = new ContentControl() { Content = model, ContentTemplateSelector = new MulticlientDataTemplateSelector(), MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight - 100, MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth - 100, }, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, }; frameworkElement.SetResourceReference(ScrollViewer.BackgroundProperty, "BaseWindowBackgroundBrush"); return frameworkElement; }