//File:Window.xaml.vb Imports System Imports System.Windows Namespace SizingPrecedenceSampleCSharp Public Partial Class MainWindow Inherits System.Windows.Window Public Sub New() InitializeComponent() End Sub Private Sub showWindowButton_Click(sender As Object, e As RoutedEventArgs) Dim sw As New MainWindow() If Me.setWSCB.IsChecked = True Then sw.WindowState = CType([Enum].Parse(GetType(WindowState), Me.wsLB.Text), WindowState) End If If Me.setMinWidthCB.IsChecked = True Then sw.MinWidth = Double.Parse(Me.minWidthTB.Text) End If If Me.setMinHeightCB.IsChecked = True Then sw.MinHeight = Double.Parse(Me.minHeightTB.Text) End If If Me.setMaxWidthCB.IsChecked = True Then sw.MaxWidth = Double.Parse(Me.maxWidthTB.Text) End If If Me.setMaxHeightCB.IsChecked = True Then sw.MaxHeight = Double.Parse(Me.maxHeightTB.Text) End If If Me.setWidthCB.IsChecked = True Then sw.Width = Double.Parse(Me.widthTB.Text) End If If Me.setHeightCB.IsChecked = True Then sw.Height = Double.Parse(Me.heightTB.Text) End If If Me.setSTCCB.IsChecked = True Then sw.SizeToContent = CType([Enum].Parse(GetType(SizeToContent), Me.stcLB.Text), SizeToContent) End If sw.Show() End Sub End Class End Namespace