Hey guys, I’ve been digging WPF stuff and I came up with two simple examples…for me it’s being fun to find out the new possibilities of this. Cheers.
dnWindow=dotnetobject "System.Windows.Window"
dnWindow.Title="WPF Test"
dnWindow.Height=200
dnWindow.Width=200
dnColor=dotnetobject "System.Windows.Media.SolidColorBrush"
dnColor.Color=(dotnetclass "System.Windows.Media.Colors").AliceBlue
dnCanvas=dotnetobject "System.Windows.Controls.Canvas"
dnCanvas.Background=dnColor
dnButton=dotnetobject "System.Windows.Controls.Button"
dnButton.Height=23
dnButton.Width=100
dnButton.Content="WPF Button Test"
dnCanvas.SetTop dnButton 10
dnCanvas.SetLeft dnButton 10
dnWindow.Content=dnCanvas
dnCanvas.Children.Add(dnButton)
dnWindow.Show()
XamlReader=dotnetclass "System.Windows.Markup.XamlReader"
XamlString="<Window
xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"
Title=\"Window1\" Height=\"300\" Width=\"300\">
<Grid>
<Button Height=\"22\" HorizontalAlignment=\"Left\" Margin=\"12,12,0,0\" Name=\"Button1\" VerticalAlignment=\"Top\" Width=\"87\">Button</Button>
<ComboBox Margin=\"0,12,12,0\" Name=\"ComboBox1\" Height=\"22\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Right\" Width=\"122\" />
<ListBox Margin=\"12,58,12,12\" Name=\"ListBox1\" />
</Grid>
</Window>"
XamlWindow=XamlReader.Parse XamlString
XamlWindow.Show()
I find the second example to have great habilities in terms of UI design for maxscripts
EDIT: You need to install .NET 3.5 SP1