In XAML kun je door code te schrijven je form ontwerpen maar kun je ook rechtstreeks op het form werken en dan heb je nog de properties. M'n code voor m'n form:
<UserControl x:Class="Music_Player_v1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d

esignHeight="170" d

esignWidth="590">
<Grid x:Name="LayoutRoot" Background="White">
<Button Content="PLAY" Height="30" HorizontalAlignment="Left" Name="Play" VerticalAlignment="Top" Width="80" Margin="500,90,0,0"></Button>
<Button Content="Toepassen" Height="30" HorizontalAlignment="Left" Name="Toepassen1" VerticalAlignment="Top" Width="80" Margin="500,10,0,0"></Button>
<Button Content="Toepassen" Height="30" HorizontalAlignment="Left" Name="Toepassen2" VerticalAlignment="Top" Width="80" Margin="500,50,0,0"></Button>
<ProgressBar Height="30" HorizontalAlignment="Left" Margin="10,130,0,0" Name="ProgressBar1" VerticalAlignment="Top" Width="570" Maximum="100" Value="0"></ProgressBar>
<ComboBox Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="comboBox1" VerticalAlignment="Top" Width="480">
<ComboBoxItem Name="comboboxitem1" Content="AC-DC" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem2" Content="Aerosmith" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem3" Content="Bullet for my Valentine" MaxHeight="20" MaxWidth="480" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem4" Content="Iron Maiden" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem5" Content="Jonas Brothers" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem6" Content="Nickelback" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem7" Content="Rammstein" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem8" Content="The opposites" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
</ComboBox>
<ComboBox Height="30" HorizontalAlignment="Left" Name="comboBox2" VerticalAlignment="Top" Width="480" Margin="10,50,0,0">
<ComboBoxItem Name="comboboxitem9" Content="Highway to hell" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" IsEnabled="True" Visibility="Collapsed" />
<ComboBoxItem Name="comboboxitem10" Content="Back in black" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem11" Content="For those about to rock we salute you" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem12" Content="Flick of the switch" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem13" Content="74 jailbreak" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem14" Content="Fly on the wall" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem15" Content="Who made who" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem16" Content="The razor's edge" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitme17" Content="Ballbreaker" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem18" Content="Stiff upper lip" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem19" Content="Black ice" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem20" Content="Big ones" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480" />
<ComboBoxItem Name="comboboxitem21" Content="Domination" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem22" Content="Fever" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem23" Content="Hand of blood " MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem24" Content="Scream, aim, fire" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem25" Content="Tears don't fall" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem26" Content="The poison" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem27" Content="Iron Maiden" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem28" Content="It's about time" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem29" Content="Lines, vines and trying times" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem30" Content="Jonas Brothers" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem31" Content="A little bit longer" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem32" Content="Curb" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem33" Content="Liebe ist für alle da" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem34" Content="Rosenrot" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
<ComboBoxItem Name="comboboxitem35" Content="(geen album, aparte liedjes)" MaxHeight="20" MaxWidth="500" MinHeight="20" MinWidth="480"/>
</ComboBox>
<ComboBox Height="30" HorizontalAlignment="Left" Margin="10,90,0,0" Name="comboBox3" VerticalAlignment="Top" Width="480" />
</Grid>
</UserControl>
En dan me code om de buttons en comboboxen opdrachten te geven (dit is wel in de VB variant, je kunt dit ook nog doen in C#)
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
Private Sub Toepassen1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Toepassen1.Click
If ProgressBar1.Value = 33 Then
MessageBox.Show("Fout, om deze error te voorkomen moet U eerst een album selecteren bij de volgende stap.")
Else
ProgressBar1.Value = 33
(Hier staat de 1 regel code die altijd blokkeert: )If comboBox1.SelectionBoxItem = comboboxitem1 Then
comboboxitem9.Visibility = Windows.Visibility.Visible
End If
End If
End Sub
Private Sub MainPage_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
End Sub
Private Sub comboboxitem9_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles comboboxitem9.Loaded
End Sub
End Class