public override void Apply() { // Expected: Managed Debugging Assistant LoadFromContext // See Also: http://stackoverflow.com/questions/31362077/loadfromcontext-occured WindowChrome = new WindowChrome() { CaptionHeight = 35, GlassFrameThickness = new Thickness(0), ResizeBorderThickness = new Thickness(7), CornerRadius = new CornerRadius(10) }; WindowChrome.SetWindowChrome(Decorated, WindowChrome); MainGrid = new Grid(); MainGrid.RowDefinitions.Add(TitleRow = new RowDefinition { Height = new GridLength(35) }); MainGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); MainGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(100, GridUnitType.Star) }); MainGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(0, GridUnitType.Auto) }); MainBorder.Child = MainGrid; MainBorder.Padding = new Thickness(8); MainGrid.Children.Add(ContentArea); Grid.SetRow(ContentArea, 1); Grid.SetColumnSpan(ContentArea, 2); AddTitleBar(); AddWindowControls(); Decorated.PropertyChanged += DecoratedOnPropertyChanged; }
public override void Apply() { WindowChrome = new WindowChrome() { CaptionHeight = 35, GlassFrameThickness = new Thickness(0), ResizeBorderThickness = new Thickness(7), CornerRadius = new CornerRadius(10) }; WindowChrome.SetWindowChrome(Decorated, WindowChrome); MainGrid = new Grid(); MainGrid.RowDefinitions.Add(TitleRow = new RowDefinition { Height = new GridLength(35) }); MainGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); MainGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(100, GridUnitType.Star) }); MainGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(0, GridUnitType.Auto) }); MainBorder.Child = MainGrid; MainBorder.Padding = new Thickness(8); MainGrid.Children.Add(ContentArea); Grid.SetRow(ContentArea, 1); Grid.SetColumnSpan(ContentArea, 2); AddTitleBar(); AddWindowControls(); Decorated.PropertyChanged += DecoratedOnPropertyChanged; }