The problem is with your event handler instead of what you have try this
private void Button_Click(object sender, RoutedEventArgs e)
{
var serial = new VLANS();
vlan.Add(serial)
serial.S_No = vlan.Count;
serial.VlanName = t1.Text;
vlan.Add(serial);
}